Browse Source

updated tests to reflect changes to query module

pull/666/head
Stephen Hess 8 years ago
parent
commit
9f350eb117
  1. 15
      test/unit/fixture/search_boundary_country.js
  2. 204
      test/unit/fixture/search_fallback.js
  3. 15
      test/unit/fixture/search_geodisambiguation.js
  4. 15
      test/unit/fixture/search_linguistic_bbox.js
  5. 15
      test/unit/fixture/search_linguistic_focus.js
  6. 15
      test/unit/fixture/search_linguistic_focus_bbox.js
  7. 15
      test/unit/fixture/search_linguistic_focus_null_island.js
  8. 15
      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. 15
      test/unit/fixture/search_with_category_filtering.js
  12. 15
      test/unit/fixture/search_with_source_filtering.js

15
test/unit/fixture/search_boundary_country.js

@ -55,5 +55,18 @@ module.exports = {
} }
}, },
'size': 10, 'size': 10,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

204
test/unit/fixture/search_fallback.js

@ -69,7 +69,9 @@ module.exports = {
'type': 'phrase', 'type': 'phrase',
'fields': [ 'fields': [
'parent.region', 'parent.region',
'parent.region_a' 'parent.region_a',
'parent.macroregion',
'parent.macroregion_a'
] ]
} }
}, },
@ -107,6 +109,11 @@ module.exports = {
'address_parts.street': 'street value' 'address_parts.street': 'street value'
} }
}, },
{
'match_phrase': {
'address_parts.zip': 'postalcode value'
}
},
{ {
'multi_match': { 'multi_match': {
'query': 'neighbourhood value', 'query': 'neighbourhood value',
@ -157,7 +164,9 @@ module.exports = {
'type': 'phrase', 'type': 'phrase',
'fields': [ 'fields': [
'parent.region', 'parent.region',
'parent.region_a' 'parent.region_a',
'parent.macroregion',
'parent.macroregion_a'
] ]
} }
}, },
@ -235,7 +244,9 @@ module.exports = {
'type': 'phrase', 'type': 'phrase',
'fields': [ 'fields': [
'parent.region', 'parent.region',
'parent.region_a' 'parent.region_a',
'parent.macroregion',
'parent.macroregion_a'
] ]
} }
}, },
@ -303,7 +314,9 @@ module.exports = {
'type': 'phrase', 'type': 'phrase',
'fields': [ 'fields': [
'parent.region', 'parent.region',
'parent.region_a' 'parent.region_a',
'parent.macroregion',
'parent.macroregion_a'
] ]
} }
}, },
@ -359,7 +372,9 @@ module.exports = {
'type': 'phrase', 'type': 'phrase',
'fields': [ 'fields': [
'parent.region', 'parent.region',
'parent.region_a' 'parent.region_a',
'parent.macroregion',
'parent.macroregion_a'
] ]
} }
}, },
@ -385,8 +400,18 @@ module.exports = {
}, },
{ {
'bool': { 'bool': {
'_name': 'fallback.county', '_name': 'fallback.localadmin',
'must': [ 'must': [
{
'multi_match': {
'query': 'city value',
'type': 'phrase',
'fields': [
'parent.localadmin',
'parent.localadmin_a'
]
}
},
{ {
'multi_match': { 'multi_match': {
'query': 'county value', 'query': 'county value',
@ -405,7 +430,55 @@ module.exports = {
'type': 'phrase', 'type': 'phrase',
'fields': [ 'fields': [
'parent.region', 'parent.region',
'parent.region_a' 'parent.region_a',
'parent.macroregion',
'parent.macroregion_a'
]
}
},
{
'multi_match': {
'query': 'country value',
'type': 'phrase',
'fields': [
'parent.country',
'parent.country_a',
'parent.dependency',
'parent.dependency_a'
]
}
}
],
'filter': {
'term': {
'layer': 'localadmin'
}
}
}
},
{
'bool': {
'_name': 'fallback.county',
'must': [
{
'multi_match': {
'query': 'county value',
'type': 'phrase',
'fields': [
'parent.county',
'parent.county_a'
]
}
},
{
'multi_match': {
'query': 'state value',
'type': 'phrase',
'fields': [
'parent.region',
'parent.region_a',
'parent.macroregion',
'parent.macroregion_a'
] ]
} }
}, },
@ -429,6 +502,52 @@ module.exports = {
} }
} }
}, },
{
'bool': {
'_name': 'fallback.macrocounty',
'must': [
{
'multi_match': {
'query': 'county value',
'type': 'phrase',
'fields': [
'parent.macrocounty',
'parent.macrocounty_a'
]
}
},
{
'multi_match': {
'query': 'state value',
'type': 'phrase',
'fields': [
'parent.region',
'parent.region_a',
'parent.macroregion',
'parent.macroregion_a'
]
}
},
{
'multi_match': {
'query': 'country value',
'type': 'phrase',
'fields': [
'parent.country',
'parent.country_a',
'parent.dependency',
'parent.dependency_a'
]
}
}
],
'filter': {
'term': {
'layer': 'macrocounty'
}
}
}
},
{ {
'bool': { 'bool': {
'_name': 'fallback.region', '_name': 'fallback.region',
@ -465,8 +584,18 @@ module.exports = {
}, },
{ {
'bool': { 'bool': {
'_name': 'fallback.country', '_name': 'fallback.macroregion',
'must': [ 'must': [
{
'multi_match': {
'query': 'state value',
'type': 'phrase',
'fields': [
'parent.macroregion',
'parent.macroregion_a'
]
}
},
{ {
'multi_match': { 'multi_match': {
'query': 'country value', 'query': 'country value',
@ -480,6 +609,50 @@ module.exports = {
} }
} }
], ],
'filter': {
'term': {
'layer': 'macroregion'
}
}
}
},
{
'bool': {
'_name': 'fallback.dependency',
'must': [
{
'multi_match': {
'query': 'country value',
'type': 'phrase',
'fields': [
'parent.dependency',
'parent.dependency_a'
]
}
}
],
'filter': {
'term': {
'layer': 'dependency'
}
}
}
},
{
'bool': {
'_name': 'fallback.country',
'must': [
{
'multi_match': {
'query': 'country value',
'type': 'phrase',
'fields': [
'parent.country',
'parent.country_a'
]
}
}
],
'filter': { 'filter': {
'term': { 'term': {
'layer': 'country' 'layer': 'country'
@ -521,5 +694,18 @@ module.exports = {
} }
}, },
'size': 20, 'size': 20,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

15
test/unit/fixture/search_geodisambiguation.js

@ -250,5 +250,18 @@ module.exports = {
} }
}, },
'size': 20, 'size': 20,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

15
test/unit/fixture/search_linguistic_bbox.js

@ -58,5 +58,18 @@ module.exports = {
} }
}, },
'size': 10, 'size': 10,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

15
test/unit/fixture/search_linguistic_focus.js

@ -61,5 +61,18 @@ module.exports = {
} }
}, },
'size': 10, 'size': 10,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

15
test/unit/fixture/search_linguistic_focus_bbox.js

@ -72,5 +72,18 @@ module.exports = {
} }
}, },
'size': 10, 'size': 10,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

15
test/unit/fixture/search_linguistic_focus_null_island.js

@ -61,5 +61,18 @@ module.exports = {
} }
}, },
'size': 10, 'size': 10,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

15
test/unit/fixture/search_linguistic_only.js

@ -47,5 +47,18 @@ module.exports = {
} }
}, },
'size': 10, 'size': 10,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

15
test/unit/fixture/search_linguistic_viewport.js

@ -47,5 +47,18 @@ module.exports = {
} }
}, },
'size': 10, 'size': 10,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

15
test/unit/fixture/search_linguistic_viewport_min_diagonal.js

@ -47,5 +47,18 @@ module.exports = {
} }
}, },
'size': 10, 'size': 10,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

15
test/unit/fixture/search_with_category_filtering.js

@ -48,5 +48,18 @@ module.exports = {
} }
}, },
'size': 20, 'size': 20,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

15
test/unit/fixture/search_with_source_filtering.js

@ -47,5 +47,18 @@ module.exports = {
} }
}, },
'size': 20, 'size': 20,
'track_scores': true 'track_scores': true,
'sort': [
{
'population': {
'order': 'desc'
}
},
{
'popularity': {
'order': 'desc'
}
},
'_score'
]
}; };

Loading…
Cancel
Save