Browse Source

remove ngram analysis from search endpoint

remove_ngrams_from_search
Peter Johnson 9 years ago
parent
commit
9b3715c8c0
  1. 3
      query/search.js
  2. 16
      test/unit/fixture/search_boundary_country.js
  3. 13
      test/unit/fixture/search_full_address.js
  4. 12
      test/unit/fixture/search_linguistic_bbox.js
  5. 12
      test/unit/fixture/search_linguistic_focus.js
  6. 12
      test/unit/fixture/search_linguistic_focus_bbox.js
  7. 12
      test/unit/fixture/search_linguistic_focus_null_island.js
  8. 12
      test/unit/fixture/search_linguistic_only.js
  9. 15
      test/unit/fixture/search_linguistic_viewport.js
  10. 15
      test/unit/fixture/search_linguistic_viewport_min_diagonal.js
  11. 12
      test/unit/fixture/search_partial_address.js
  12. 12
      test/unit/fixture/search_regions_address.js

3
query/search.js

@ -11,10 +11,9 @@ var query = new peliasQuery.layout.FilteredBooleanQuery();
// mandatory matches
query.score( peliasQuery.view.boundary_country, 'must' );
query.score( peliasQuery.view.ngrams, 'must' );
query.score( peliasQuery.view.phrase, 'must' );
// scoring boost
query.score( peliasQuery.view.phrase );
query.score( peliasQuery.view.focus( peliasQuery.view.phrase ) );
query.score( peliasQuery.view.popularity( peliasQuery.view.phrase ) );
query.score( peliasQuery.view.population( peliasQuery.view.phrase ) );

16
test/unit/fixture/search_boundary_country.js

@ -15,25 +15,17 @@ module.exports = {
},
{
'match': {
'name.default': {
'phrase.default': {
'query': 'test',
'analyzer': 'peliasPhrase',
'type': 'phrase',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
'slop': 2
}
}
}
],
'should': [{
'match': {
'phrase.default': {
'query': 'test',
'analyzer': 'peliasPhrase',
'type': 'phrase',
'boost': 1,
'slop': 2
}
}
},{
'function_score': {
'query': {
'match': {

13
test/unit/fixture/search_full_address.js

@ -8,15 +8,6 @@ module.exports = {
'query': {
'bool': {
'must': [{
'match': {
'name.default': {
'query': '123 main st',
'analyzer': 'peliasOneEdgeGram',
'boost': 1
}
}
}],
'should': [{
'match': {
'phrase.default': {
'query': '123 main st',
@ -26,8 +17,8 @@ module.exports = {
'boost': 1
}
}
},
{
}],
'should': [{
'function_score': {
'query': {
'match': {

12
test/unit/fixture/search_linguistic_bbox.js

@ -5,15 +5,6 @@ module.exports = {
'query': {
'bool': {
'must': [{
'match': {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
}
}
}],
'should': [{
'match': {
'phrase.default': {
'query': 'test',
@ -23,7 +14,8 @@ module.exports = {
'slop': 2
}
}
},{
}],
'should': [{
'function_score': {
'query': {
'match': {

12
test/unit/fixture/search_linguistic_focus.js

@ -5,15 +5,6 @@ module.exports = {
'query': {
'bool': {
'must': [{
'match': {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
}
}
}],
'should': [{
'match': {
'phrase.default': {
'query': 'test',
@ -23,7 +14,8 @@ module.exports = {
'slop': 2
}
}
}, {
}],
'should': [{
'function_score': {
'query': {
'match': {

12
test/unit/fixture/search_linguistic_focus_bbox.js

@ -5,15 +5,6 @@ module.exports = {
'query': {
'bool': {
'must': [{
'match': {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
}
}
}],
'should': [{
'match': {
'phrase.default': {
'query': 'test',
@ -23,7 +14,8 @@ module.exports = {
'slop': 2
}
}
}, {
}],
'should': [{
'function_score': {
'query': {
'match': {

12
test/unit/fixture/search_linguistic_focus_null_island.js

@ -5,15 +5,6 @@ module.exports = {
'query': {
'bool': {
'must': [{
'match': {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
}
}
}],
'should': [{
'match': {
'phrase.default': {
'query': 'test',
@ -23,7 +14,8 @@ module.exports = {
'slop': 2
}
}
}, {
}],
'should': [{
'function_score': {
'query': {
'match': {

12
test/unit/fixture/search_linguistic_only.js

@ -5,15 +5,6 @@ module.exports = {
'query': {
'bool': {
'must': [{
'match': {
'name.default': {
'query': 'test',
'boost': 1,
'analyzer': 'peliasOneEdgeGram'
}
}
}],
'should': [{
'match': {
'phrase.default': {
'query': 'test',
@ -23,7 +14,8 @@ module.exports = {
'slop': 2
}
}
},{
}],
'should': [{
'function_score': {
'query': {
'match': {

15
test/unit/fixture/search_linguistic_viewport.js

@ -4,17 +4,6 @@ module.exports = {
'query': {
'bool': {
'must': [
{
'match': {
'name.default': {
'analyzer': 'peliasOneEdgeGram',
'boost': 1,
'query': 'test'
}
}
}
],
'should': [
{
'match': {
'phrase.default': {
@ -25,7 +14,9 @@ module.exports = {
'query': 'test'
}
}
},
}
],
'should': [
{
'function_score': {
'query': {

15
test/unit/fixture/search_linguistic_viewport_min_diagonal.js

@ -4,17 +4,6 @@ module.exports = {
'query': {
'bool': {
'must': [
{
'match': {
'name.default': {
'analyzer': 'peliasOneEdgeGram',
'boost': 1,
'query': 'test'
}
}
}
],
'should': [
{
'match': {
'phrase.default': {
@ -25,7 +14,9 @@ module.exports = {
'query': 'test'
}
}
},
}
],
'should': [
{
'function_score': {
'query': {

12
test/unit/fixture/search_partial_address.js

@ -8,15 +8,6 @@ module.exports = {
'query': {
'bool': {
'must': [{
'match': {
'name.default': {
'query': 'soho grand',
'analyzer': 'peliasOneEdgeGram',
'boost': 1
}
}
}],
'should': [{
'match': {
'phrase.default': {
'query': 'soho grand',
@ -26,7 +17,8 @@ module.exports = {
'boost': 1
}
}
},{
}],
'should': [{
'function_score': {
'query': {
'match': {

12
test/unit/fixture/search_regions_address.js

@ -8,15 +8,6 @@ module.exports = {
'query': {
'bool': {
'must': [{
'match': {
'name.default': {
'query': '1 water st',
'analyzer': 'peliasOneEdgeGram',
'boost': 1
}
}
}],
'should': [{
'match': {
'phrase.default': {
'query': '1 water st',
@ -26,7 +17,8 @@ module.exports = {
'boost': 1
}
}
},{
}],
'should': [{
'function_score': {
'query': {
'match': {

Loading…
Cancel
Save