diff --git a/test/unit/fixture/search_boundary_country.js b/test/unit/fixture/search_boundary_country.js index 977b15c9..ea653da8 100644 --- a/test/unit/fixture/search_boundary_country.js +++ b/test/unit/fixture/search_boundary_country.js @@ -55,5 +55,18 @@ module.exports = { } }, 'size': 10, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_fallback.js b/test/unit/fixture/search_fallback.js index 6c076c61..12b617a3 100644 --- a/test/unit/fixture/search_fallback.js +++ b/test/unit/fixture/search_fallback.js @@ -69,7 +69,9 @@ module.exports = { 'type': 'phrase', 'fields': [ 'parent.region', - 'parent.region_a' + 'parent.region_a', + 'parent.macroregion', + 'parent.macroregion_a' ] } }, @@ -107,6 +109,11 @@ module.exports = { 'address_parts.street': 'street value' } }, + { + 'match_phrase': { + 'address_parts.zip': 'postalcode value' + } + }, { 'multi_match': { 'query': 'neighbourhood value', @@ -157,7 +164,9 @@ module.exports = { 'type': 'phrase', 'fields': [ 'parent.region', - 'parent.region_a' + 'parent.region_a', + 'parent.macroregion', + 'parent.macroregion_a' ] } }, @@ -235,7 +244,9 @@ module.exports = { 'type': 'phrase', 'fields': [ 'parent.region', - 'parent.region_a' + 'parent.region_a', + 'parent.macroregion', + 'parent.macroregion_a' ] } }, @@ -303,7 +314,9 @@ module.exports = { 'type': 'phrase', 'fields': [ 'parent.region', - 'parent.region_a' + 'parent.region_a', + 'parent.macroregion', + 'parent.macroregion_a' ] } }, @@ -359,7 +372,9 @@ module.exports = { 'type': 'phrase', 'fields': [ 'parent.region', - 'parent.region_a' + 'parent.region_a', + 'parent.macroregion', + 'parent.macroregion_a' ] } }, @@ -385,8 +400,18 @@ module.exports = { }, { 'bool': { - '_name': 'fallback.county', + '_name': 'fallback.localadmin', 'must': [ + { + 'multi_match': { + 'query': 'city value', + 'type': 'phrase', + 'fields': [ + 'parent.localadmin', + 'parent.localadmin_a' + ] + } + }, { 'multi_match': { 'query': 'county value', @@ -405,7 +430,55 @@ module.exports = { 'type': 'phrase', 'fields': [ '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': { '_name': 'fallback.region', @@ -465,8 +584,18 @@ module.exports = { }, { 'bool': { - '_name': 'fallback.country', + '_name': 'fallback.macroregion', 'must': [ + { + 'multi_match': { + 'query': 'state value', + 'type': 'phrase', + 'fields': [ + 'parent.macroregion', + 'parent.macroregion_a' + ] + } + }, { 'multi_match': { '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': { 'term': { 'layer': 'country' @@ -521,5 +694,18 @@ module.exports = { } }, 'size': 20, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_geodisambiguation.js b/test/unit/fixture/search_geodisambiguation.js index 34b447e1..5db0af98 100644 --- a/test/unit/fixture/search_geodisambiguation.js +++ b/test/unit/fixture/search_geodisambiguation.js @@ -250,5 +250,18 @@ module.exports = { } }, 'size': 20, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_linguistic_bbox.js b/test/unit/fixture/search_linguistic_bbox.js index 9470529d..e6582e29 100644 --- a/test/unit/fixture/search_linguistic_bbox.js +++ b/test/unit/fixture/search_linguistic_bbox.js @@ -58,5 +58,18 @@ module.exports = { } }, 'size': 10, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_linguistic_focus.js b/test/unit/fixture/search_linguistic_focus.js index 25cefa2e..6af7efcf 100644 --- a/test/unit/fixture/search_linguistic_focus.js +++ b/test/unit/fixture/search_linguistic_focus.js @@ -61,5 +61,18 @@ module.exports = { } }, 'size': 10, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_linguistic_focus_bbox.js b/test/unit/fixture/search_linguistic_focus_bbox.js index 6523232f..4126d479 100644 --- a/test/unit/fixture/search_linguistic_focus_bbox.js +++ b/test/unit/fixture/search_linguistic_focus_bbox.js @@ -72,5 +72,18 @@ module.exports = { } }, 'size': 10, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_linguistic_focus_null_island.js b/test/unit/fixture/search_linguistic_focus_null_island.js index c6ccdd40..9e7b299c 100644 --- a/test/unit/fixture/search_linguistic_focus_null_island.js +++ b/test/unit/fixture/search_linguistic_focus_null_island.js @@ -61,5 +61,18 @@ module.exports = { } }, 'size': 10, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_linguistic_only.js b/test/unit/fixture/search_linguistic_only.js index 08254737..37767375 100644 --- a/test/unit/fixture/search_linguistic_only.js +++ b/test/unit/fixture/search_linguistic_only.js @@ -47,5 +47,18 @@ module.exports = { } }, 'size': 10, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_linguistic_viewport.js b/test/unit/fixture/search_linguistic_viewport.js index 08254737..37767375 100644 --- a/test/unit/fixture/search_linguistic_viewport.js +++ b/test/unit/fixture/search_linguistic_viewport.js @@ -47,5 +47,18 @@ module.exports = { } }, 'size': 10, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_linguistic_viewport_min_diagonal.js b/test/unit/fixture/search_linguistic_viewport_min_diagonal.js index 08254737..37767375 100644 --- a/test/unit/fixture/search_linguistic_viewport_min_diagonal.js +++ b/test/unit/fixture/search_linguistic_viewport_min_diagonal.js @@ -47,5 +47,18 @@ module.exports = { } }, 'size': 10, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_with_category_filtering.js b/test/unit/fixture/search_with_category_filtering.js index 3c217c35..9aa12a66 100644 --- a/test/unit/fixture/search_with_category_filtering.js +++ b/test/unit/fixture/search_with_category_filtering.js @@ -48,5 +48,18 @@ module.exports = { } }, 'size': 20, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] }; diff --git a/test/unit/fixture/search_with_source_filtering.js b/test/unit/fixture/search_with_source_filtering.js index 454c317d..0fdbdc24 100644 --- a/test/unit/fixture/search_with_source_filtering.js +++ b/test/unit/fixture/search_with_source_filtering.js @@ -47,5 +47,18 @@ module.exports = { } }, 'size': 20, - 'track_scores': true + 'track_scores': true, + 'sort': [ + { + 'population': { + 'order': 'desc' + } + }, + { + 'popularity': { + 'order': 'desc' + } + }, + '_score' + ] };