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. 8
      test/unit/fixture/structured_geocoding/boundary_country.json
  14. 1595
      test/unit/fixture/structured_geocoding/fallback.json
  15. 8
      test/unit/fixture/structured_geocoding/linguistic_bbox.json
  16. 8
      test/unit/fixture/structured_geocoding/linguistic_focus.json
  17. 8
      test/unit/fixture/structured_geocoding/linguistic_focus_bbox.json
  18. 8
      test/unit/fixture/structured_geocoding/linguistic_focus_null_island.json
  19. 8
      test/unit/fixture/structured_geocoding/linguistic_only.json
  20. 8
      test/unit/fixture/structured_geocoding/linguistic_viewport.json
  21. 8
      test/unit/fixture/structured_geocoding/linguistic_viewport_min_diagonal.json
  22. 49
      test/unit/fixture/structured_geocoding/postalcode_only.js
  23. 9
      test/unit/fixture/structured_geocoding/with_source_filtering.json

40
test/unit/fixture/search_boundary_country.js

@ -2,32 +2,28 @@ 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': {
'should': [
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
}
]
}
}
},
],
'filter': {
'bool': {
'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': {
'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': {
'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,

40
test/unit/fixture/search_linguistic_bbox.js

@ -2,32 +2,28 @@ 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': {
'should': [
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
}
]
}
}
},
],
'filter': {
'bool': {
'must': [

40
test/unit/fixture/search_linguistic_focus.js

@ -2,32 +2,28 @@ 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': {
'should': [
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
}
]
}
}
},
],
'filter': {
'bool': {
'must': [

40
test/unit/fixture/search_linguistic_focus_bbox.js

@ -2,32 +2,28 @@ 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': {
'should': [
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
}
]
}
}
},
],
'filter': {
'bool': {
'must': [

40
test/unit/fixture/search_linguistic_focus_null_island.js

@ -2,32 +2,28 @@ 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': {
'should': [
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
}
]
}
}
},
],
'filter': {
'bool': {
'must': [

40
test/unit/fixture/search_linguistic_only.js

@ -2,32 +2,28 @@ 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': {
'should': [
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
}
]
}
}
},
],
'filter': {
'bool': {
'must': [

40
test/unit/fixture/search_linguistic_viewport.js

@ -2,32 +2,28 @@ 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': {
'should': [
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
}
]
}
}
},
],
'filter': {
'bool': {
'must': [

40
test/unit/fixture/search_linguistic_viewport_min_diagonal.js

@ -2,32 +2,28 @@ 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': {
'should': [
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
}
]
}
}
},
],
'filter': {
'bool': {
'must': [

40
test/unit/fixture/search_with_category_filtering.js

@ -2,32 +2,28 @@ 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': {
'should': [
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
}
]
}
}
},
],
'filter': {
'bool': {
'must': [

40
test/unit/fixture/search_with_source_filtering.js

@ -2,32 +2,28 @@ 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': {
'should': [
{
'bool': {
'_name': 'fallback.street',
'boost': 5,
'must': [
{
'match_phrase': {
'address_parts.street': 'street value'
}
}
],
'should': [],
'filter': {
'term': {
'layer': 'street'
}
}
]
}
}
},
],
'filter': {
'bool': {
'must': [

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

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

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

File diff suppressed because it is too large Load Diff

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -2,39 +2,30 @@ 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': {
'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,

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

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

Loading…
Cancel
Save