Skip to content

Commit

Permalink
refactor(integration): rewrite match phrase queries
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Oct 30, 2019
1 parent 4f1ed2c commit dbba70f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
6 changes: 2 additions & 4 deletions integration/address_matching.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,9 @@ module.exports.tests.venue_vs_address = function(test, common){
'bool': {
'must': [
{
'match': {
'match_phrase': {
'name.default': {
'analyzer': 'peliasQueryFullToken',
'type': 'phrase',
'boost': 1,
'slop': 3,
'query': 'union square'
Expand All @@ -288,10 +287,9 @@ module.exports.tests.venue_vs_address = function(test, common){
}
},
{
'match': {
'match_phrase': {
'phrase.default': {
'analyzer': 'peliasPhrase',
'type': 'phrase',
'boost': 1,
'slop': 3,
'query': 'union square'
Expand Down
6 changes: 2 additions & 4 deletions integration/analyzer_peliasPhrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,9 @@ module.exports.tests.slop_query = function(test, common){
],
'should': [
{
'match': {
'match_phrase': {
'phrase.default': {
'query': i,
'type': 'phrase',
'slop': 2
}
}
Expand Down Expand Up @@ -265,11 +264,10 @@ module.exports.tests.slop = function(test, common){
index: suite.props.index,
type: 'doc',
searchType: 'dfs_query_then_fetch',
body: { query: { match: {
body: { query: { match_phrase: {
'name.default': {
'analyzer': 'peliasPhrase',
'query': 'Görlitzer Straße 52',
'type': 'phrase',
'slop': 3,
}
}}}
Expand Down
3 changes: 1 addition & 2 deletions integration/analyzer_peliasQueryFullToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,10 @@ module.exports.tests.slop = function(test, common){
suite.client.search({
index: suite.props.index,
type: 'doc',
body: { query: { match: {
body: { query: { match_phrase: {
'name.default': {
'analyzer': 'peliasQueryFullToken',
'query': 'Görlitzer Straße 52',
'type': 'phrase',
'slop': 3,
}
}}}
Expand Down

0 comments on commit dbba70f

Please sign in to comment.