Browse Source

Use bool instead of filtered queries in fixtures

This is needed for Elasticsearch 5 support as part of https://github.com/pelias/pelias/issues/461
pull/844/head
Julian Simioni 8 years ago
parent
commit
81b52fafaf
No known key found for this signature in database
GPG Key ID: 6DAD08919FDBF563
  1. 40
      test/unit/fixture/search_boundary_country.js
  2. 1593
      test/unit/fixture/search_fallback.js
  3. 49
      test/unit/fixture/search_fallback_postalcode_only.js
  4. 40
      test/unit/fixture/search_linguistic_bbox.js
  5. 40
      test/unit/fixture/search_linguistic_focus.js
  6. 40
      test/unit/fixture/search_linguistic_focus_bbox.js
  7. 40
      test/unit/fixture/search_linguistic_focus_null_island.js
  8. 40
      test/unit/fixture/search_linguistic_only.js
  9. 40
      test/unit/fixture/search_linguistic_viewport.js
  10. 40
      test/unit/fixture/search_linguistic_viewport_min_diagonal.js
  11. 40
      test/unit/fixture/search_with_category_filtering.js
  12. 40
      test/unit/fixture/search_with_source_filtering.js
  13. 10
      test/unit/fixture/structured_geocoding/boundary_country.json
  14. 1595
      test/unit/fixture/structured_geocoding/fallback.json
  15. 10
      test/unit/fixture/structured_geocoding/linguistic_bbox.json
  16. 10
      test/unit/fixture/structured_geocoding/linguistic_focus.json
  17. 8
      test/unit/fixture/structured_geocoding/linguistic_focus_bbox.json
  18. 10
      test/unit/fixture/structured_geocoding/linguistic_focus_null_island.json
  19. 10
      test/unit/fixture/structured_geocoding/linguistic_only.json
  20. 10
      test/unit/fixture/structured_geocoding/linguistic_viewport.json
  21. 10
      test/unit/fixture/structured_geocoding/linguistic_viewport_min_diagonal.json
  22. 49
      test/unit/fixture/structured_geocoding/postalcode_only.js
  23. 11
      test/unit/fixture/structured_geocoding/with_source_filtering.json

40
test/unit/fixture/search_boundary_country.js

@ -2,32 +2,28 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.street',
'bool': { 'boost': 5,
'_name': 'fallback.street', 'must': [
'boost': 5, {
'must': [ 'match_phrase': {
{ 'address_parts.street': 'street value'
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
} }
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
] }
} }
}, ],
'filter': { 'filter': {
'bool': { 'bool': {
'must': [ 'must': [

1593
test/unit/fixture/search_fallback.js

File diff suppressed because it is too large Load Diff

49
test/unit/fixture/search_fallback_postalcode_only.js

@ -2,39 +2,30 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.postalcode',
'bool': { 'must': [
'_name': 'fallback.postalcode', {
'must': [ 'multi_match': {
{ 'query': '90210',
'multi_match': { 'type': 'phrase',
'query': '90210', 'fields': [
'type': 'phrase', 'parent.postalcode'
'fields': [ ]
'parent.postalcode'
]
}
}
],
'filter': {
'term': {
'layer': 'postalcode'
}
} }
} }
],
'filter': {
'term': {
'layer': 'postalcode'
}
} }
] }
}
},
'filter': {
'bool': {
'must': []
} }
} ]
} }
}, },
'max_boost': 20, 'max_boost': 20,

40
test/unit/fixture/search_linguistic_bbox.js

@ -2,32 +2,28 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.street',
'bool': { 'boost': 5,
'_name': 'fallback.street', 'must': [
'boost': 5, {
'must': [ 'match_phrase': {
{ 'address_parts.street': 'street value'
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
} }
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
] }
} }
}, ],
'filter': { 'filter': {
'bool': { 'bool': {
'must': [ 'must': [

40
test/unit/fixture/search_linguistic_focus.js

@ -2,32 +2,28 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.street',
'bool': { 'boost': 5,
'_name': 'fallback.street', 'must': [
'boost': 5, {
'must': [ 'match_phrase': {
{ 'address_parts.street': 'street value'
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
} }
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
] }
} }
}, ],
'filter': { 'filter': {
'bool': { 'bool': {
'must': [ 'must': [

40
test/unit/fixture/search_linguistic_focus_bbox.js

@ -2,32 +2,28 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.street',
'bool': { 'boost': 5,
'_name': 'fallback.street', 'must': [
'boost': 5, {
'must': [ 'match_phrase': {
{ 'address_parts.street': 'street value'
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
} }
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
] }
} }
}, ],
'filter': { 'filter': {
'bool': { 'bool': {
'must': [ 'must': [

40
test/unit/fixture/search_linguistic_focus_null_island.js

@ -2,32 +2,28 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.street',
'bool': { 'boost': 5,
'_name': 'fallback.street', 'must': [
'boost': 5, {
'must': [ 'match_phrase': {
{ 'address_parts.street': 'street value'
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
} }
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
] }
} }
}, ],
'filter': { 'filter': {
'bool': { 'bool': {
'must': [ 'must': [

40
test/unit/fixture/search_linguistic_only.js

@ -2,32 +2,28 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.street',
'bool': { 'boost': 5,
'_name': 'fallback.street', 'must': [
'boost': 5, {
'must': [ 'match_phrase': {
{ 'address_parts.street': 'street value'
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
} }
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
] }
} }
}, ],
'filter': { 'filter': {
'bool': { 'bool': {
'must': [ 'must': [

40
test/unit/fixture/search_linguistic_viewport.js

@ -2,32 +2,28 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.street',
'bool': { 'boost': 5,
'_name': 'fallback.street', 'must': [
'boost': 5, {
'must': [ 'match_phrase': {
{ 'address_parts.street': 'street value'
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
} }
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
] }
} }
}, ],
'filter': { 'filter': {
'bool': { 'bool': {
'must': [ 'must': [

40
test/unit/fixture/search_linguistic_viewport_min_diagonal.js

@ -2,32 +2,28 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.street',
'bool': { 'boost': 5,
'_name': 'fallback.street', 'must': [
'boost': 5, {
'must': [ 'match_phrase': {
{ 'address_parts.street': 'street value'
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
} }
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
] }
} }
}, ],
'filter': { 'filter': {
'bool': { 'bool': {
'must': [ 'must': [

40
test/unit/fixture/search_with_category_filtering.js

@ -2,32 +2,28 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.street',
'bool': { 'boost': 5,
'_name': 'fallback.street', 'must': [
'boost': 5, {
'must': [ 'match_phrase': {
{ 'address_parts.street': 'street value'
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
} }
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
] }
} }
}, ],
'filter': { 'filter': {
'bool': { 'bool': {
'must': [ 'must': [

40
test/unit/fixture/search_with_source_filtering.js

@ -2,32 +2,28 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.street',
'bool': { 'boost': 5,
'_name': 'fallback.street', 'must': [
'boost': 5, {
'must': [ 'match_phrase': {
{ 'address_parts.street': 'street value'
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
} }
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
} }
] }
} }
}, ],
'filter': { 'filter': {
'bool': { 'bool': {
'must': [ 'must': [

10
test/unit/fixture/structured_geocoding/boundary_country.json

@ -2,12 +2,8 @@
"query": { "query": {
"function_score": { "function_score": {
"query": { "query": {
"filtered": { "bool": {
"query": { "should": [],
"bool": {
"should": []
}
},
"filter": { "filter": {
"bool": { "bool": {
"must": [ "must": [
@ -59,4 +55,4 @@
], ],
"size": 10, "size": 10,
"track_scores": true "track_scores": true
} }

1595
test/unit/fixture/structured_geocoding/fallback.json

File diff suppressed because it is too large Load Diff

10
test/unit/fixture/structured_geocoding/linguistic_bbox.json

@ -2,12 +2,8 @@
"query": { "query": {
"function_score": { "function_score": {
"query": { "query": {
"filtered": { "bool": {
"query": { "should": [],
"bool": {
"should": []
}
},
"filter": { "filter": {
"bool": { "bool": {
"must": [ "must": [
@ -62,4 +58,4 @@
], ],
"size": 10, "size": 10,
"track_scores": true "track_scores": true
} }

10
test/unit/fixture/structured_geocoding/linguistic_focus.json

@ -2,12 +2,8 @@
"query": { "query": {
"function_score": { "function_score": {
"query": { "query": {
"filtered": { "bool": {
"query": { "should": [],
"bool": {
"should": []
}
},
"filter": { "filter": {
"bool": { "bool": {
"must": [ "must": [
@ -65,4 +61,4 @@
], ],
"size": 10, "size": 10,
"track_scores": true "track_scores": true
} }

8
test/unit/fixture/structured_geocoding/linguistic_focus_bbox.json

@ -2,12 +2,8 @@
"query": { "query": {
"function_score": { "function_score": {
"query": { "query": {
"filtered": { "bool": {
"query": { "should": [],
"bool": {
"should": []
}
},
"filter": { "filter": {
"bool": { "bool": {
"must": [ "must": [

10
test/unit/fixture/structured_geocoding/linguistic_focus_null_island.json

@ -2,12 +2,8 @@
"query": { "query": {
"function_score": { "function_score": {
"query": { "query": {
"filtered": { "bool": {
"query": { "should": [],
"bool": {
"should": []
}
},
"filter": { "filter": {
"bool": { "bool": {
"must": [ "must": [
@ -65,4 +61,4 @@
], ],
"size": 10, "size": 10,
"track_scores": true "track_scores": true
} }

10
test/unit/fixture/structured_geocoding/linguistic_only.json

@ -2,12 +2,8 @@
"query": { "query": {
"function_score": { "function_score": {
"query": { "query": {
"filtered": { "bool": {
"query": { "should": [],
"bool": {
"should": []
}
},
"filter": { "filter": {
"bool": { "bool": {
"must": [ "must": [
@ -51,4 +47,4 @@
], ],
"size": 10, "size": 10,
"track_scores": true "track_scores": true
} }

10
test/unit/fixture/structured_geocoding/linguistic_viewport.json

@ -2,12 +2,8 @@
"query": { "query": {
"function_score": { "function_score": {
"query": { "query": {
"filtered": { "bool": {
"query": { "should": [],
"bool": {
"should": []
}
},
"filter": { "filter": {
"bool": { "bool": {
"must": [ "must": [
@ -51,4 +47,4 @@
], ],
"size": 10, "size": 10,
"track_scores": true "track_scores": true
} }

10
test/unit/fixture/structured_geocoding/linguistic_viewport_min_diagonal.json

@ -2,12 +2,8 @@
"query": { "query": {
"function_score": { "function_score": {
"query": { "query": {
"filtered": { "bool": {
"query": { "should": [],
"bool": {
"should": []
}
},
"filter": { "filter": {
"bool": { "bool": {
"must": [ "must": [
@ -51,4 +47,4 @@
], ],
"size": 10, "size": 10,
"track_scores": true "track_scores": true
} }

49
test/unit/fixture/structured_geocoding/postalcode_only.js

@ -2,39 +2,30 @@ module.exports = {
'query': { 'query': {
'function_score': { 'function_score': {
'query': { 'query': {
'filtered': { 'bool': {
'query': { 'should': [
'bool': { {
'should': [ 'bool': {
{ '_name': 'fallback.postalcode',
'bool': { 'must': [
'_name': 'fallback.postalcode', {
'must': [ 'multi_match': {
{ 'query': 'postalcode value',
'multi_match': { 'type': 'phrase',
'query': 'postalcode value', 'fields': [
'type': 'phrase', 'parent.postalcode'
'fields': [ ]
'parent.postalcode'
]
}
}
],
'filter': {
'term': {
'layer': 'postalcode'
}
} }
} }
],
'filter': {
'term': {
'layer': 'postalcode'
}
} }
] }
}
},
'filter': {
'bool': {
'must': []
} }
} ]
} }
}, },
'max_boost': 20, 'max_boost': 20,

11
test/unit/fixture/structured_geocoding/with_source_filtering.json

@ -2,12 +2,9 @@
"query": { "query": {
"function_score": { "function_score": {
"query": { "query": {
"filtered": { "bool": {
"query": { "should": [
"bool": { ],
"should": []
}
},
"filter": { "filter": {
"bool": { "bool": {
"must": [ "must": [
@ -51,4 +48,4 @@
], ],
"size": 20, "size": 20,
"track_scores": true "track_scores": true
} }

Loading…
Cancel
Save