Browse Source

Update fixtures for Elasticsearch 5 queries

These queries use [bool](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-filtered-query.html)
queries instead of the deprecated `filtered` queries, and also set
`minimum_should_match` to 1, which was apparently implied previously.

Connects https://github.com/pelias/api/issues/762
Connects https://github.com/pelias/api/pull/844
Connects https://github.com/pelias/api/pull/855
Connects https://github.com/pelias/pelias/issues/461
pull/923/head
Julian Simioni 8 years ago
parent
commit
35c7c86492
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 41
      test/unit/fixture/search_boundary_country.js
  2. 1594
      test/unit/fixture/search_fallback.js
  3. 50
      test/unit/fixture/search_fallback_postalcode_only.js
  4. 41
      test/unit/fixture/search_linguistic_bbox.js
  5. 41
      test/unit/fixture/search_linguistic_focus.js
  6. 41
      test/unit/fixture/search_linguistic_focus_bbox.js
  7. 41
      test/unit/fixture/search_linguistic_focus_null_island.js
  8. 41
      test/unit/fixture/search_linguistic_only.js
  9. 41
      test/unit/fixture/search_linguistic_viewport.js
  10. 41
      test/unit/fixture/search_linguistic_viewport_min_diagonal.js
  11. 41
      test/unit/fixture/search_with_category_filtering.js
  12. 41
      test/unit/fixture/search_with_source_filtering.js
  13. 11
      test/unit/fixture/structured_geocoding/boundary_country.json
  14. 1596
      test/unit/fixture/structured_geocoding/fallback.json
  15. 11
      test/unit/fixture/structured_geocoding/linguistic_bbox.json
  16. 11
      test/unit/fixture/structured_geocoding/linguistic_focus.json
  17. 9
      test/unit/fixture/structured_geocoding/linguistic_focus_bbox.json
  18. 11
      test/unit/fixture/structured_geocoding/linguistic_focus_null_island.json
  19. 11
      test/unit/fixture/structured_geocoding/linguistic_only.json
  20. 11
      test/unit/fixture/structured_geocoding/linguistic_viewport.json
  21. 11
      test/unit/fixture/structured_geocoding/linguistic_viewport_min_diagonal.json
  22. 50
      test/unit/fixture/structured_geocoding/postalcode_only.js
  23. 12
      test/unit/fixture/structured_geocoding/with_source_filtering.json

41
test/unit/fixture/search_boundary_country.js

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

1594
test/unit/fixture/search_fallback.js

File diff suppressed because it is too large Load Diff

50
test/unit/fixture/search_fallback_postalcode_only.js

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

41
test/unit/fixture/search_linguistic_bbox.js

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

41
test/unit/fixture/search_linguistic_focus.js

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

41
test/unit/fixture/search_linguistic_focus_bbox.js

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

41
test/unit/fixture/search_linguistic_focus_null_island.js

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

41
test/unit/fixture/search_linguistic_only.js

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

41
test/unit/fixture/search_linguistic_viewport.js

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

41
test/unit/fixture/search_linguistic_viewport_min_diagonal.js

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

41
test/unit/fixture/search_with_category_filtering.js

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

41
test/unit/fixture/search_with_source_filtering.js

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

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

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

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

File diff suppressed because it is too large Load Diff

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save