Browse Source

boost phrase matching

phrase_slop_disable_tf_idf
Peter Johnson 10 years ago
parent
commit
29ef42e290
  1. 5
      query/search.js
  2. 15
      test/unit/query/search.js

5
query/search.js

@ -100,7 +100,7 @@ function generate( params ){
}
// add search condition to distance query
query.query.filtered.query.bool.must.push({
query.query.filtered.query.bool.must.push({
'match': {
'name.default': {
'query': input,
@ -117,7 +117,8 @@ function generate( params ){
'query': input,
'analyzer': 'peliasPhrase',
'type': 'phrase',
'slop': 2
'slop': 2,
'boost': 2
}
}
});

15
test/unit/query/search.js

@ -92,7 +92,8 @@ var expected = {
'query': 'test',
'analyzer': 'peliasPhrase',
'type': 'phrase',
'slop': 2
'slop': 2,
'boost': 2
}
}
}]
@ -182,7 +183,8 @@ module.exports.tests.query = function(test, common) {
'query': 'test',
'analyzer': 'peliasPhrase',
'type': 'phrase',
'slop': 2
'slop': 2,
'boost': 2
}
}
}]
@ -230,7 +232,8 @@ module.exports.tests.query = function(test, common) {
'query': 'test',
'analyzer': 'peliasPhrase',
'type': 'phrase',
'slop': 2
'slop': 2,
'boost': 2
}
}
}]
@ -323,7 +326,8 @@ module.exports.tests.query = function(test, common) {
'query': '123 main st',
'analyzer': 'peliasPhrase',
'type': 'phrase',
'slop': 2
'slop': 2,
'boost': 2
}
}
}
@ -480,7 +484,8 @@ module.exports.tests.query = function(test, common) {
'query': 'soho grand',
'analyzer': 'peliasPhrase',
'type': 'phrase',
'slop': 2
'slop': 2,
'boost': 2
}
}
}

Loading…
Cancel
Save