diff --git a/layout/AddressesUsingIdsQuery.js b/layout/AddressesUsingIdsQuery.js index 682fe70..8bda67b 100644 --- a/layout/AddressesUsingIdsQuery.js +++ b/layout/AddressesUsingIdsQuery.js @@ -135,7 +135,8 @@ class AddressesUsingIdsQuery extends Query { } }, size: vs.var('size'), - track_scores: vs.var('track_scores') + track_scores: vs.var('track_scores'), + sort: ['_score', '_id'] }; // add unit/housenumber/street if available diff --git a/layout/FilteredBooleanQuery.js b/layout/FilteredBooleanQuery.js index 3ef7811..a337f53 100644 --- a/layout/FilteredBooleanQuery.js +++ b/layout/FilteredBooleanQuery.js @@ -70,7 +70,7 @@ Layout.base = function( vs ){ }, size: vs.var('size'), track_scores: vs.var('track_scores'), - sort: ['_score'] + sort: ['_score', '_id'] }; }; diff --git a/layout/VenuesQuery.js b/layout/VenuesQuery.js index 69d24df..5424327 100644 --- a/layout/VenuesQuery.js +++ b/layout/VenuesQuery.js @@ -41,7 +41,8 @@ class VenuesQuery extends Query { } }, size: vs.var('size'), - track_scores: vs.var('track_scores') + track_scores: vs.var('track_scores'), + sort: ['_score', '_id'] }; // add any scores (_.compact removes falsey values from arrays) diff --git a/layout/baseQuery.js b/layout/baseQuery.js index fa6a3c7..aeb592e 100644 --- a/layout/baseQuery.js +++ b/layout/baseQuery.js @@ -15,6 +15,7 @@ module.exports = { } }, sort: [ - '_score' + '_score', + '_id' ] }; diff --git a/test/fixtures/addressesUsingIdsQuery/housenumber_no_units.json b/test/fixtures/addressesUsingIdsQuery/housenumber_no_units.json index aa959a7..b476fbb 100644 --- a/test/fixtures/addressesUsingIdsQuery/housenumber_no_units.json +++ b/test/fixtures/addressesUsingIdsQuery/housenumber_no_units.json @@ -56,5 +56,9 @@ } }, "size": "size value", - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/addressesUsingIdsQuery/no_housenumber.json b/test/fixtures/addressesUsingIdsQuery/no_housenumber.json index a5928f4..74ab60d 100644 --- a/test/fixtures/addressesUsingIdsQuery/no_housenumber.json +++ b/test/fixtures/addressesUsingIdsQuery/no_housenumber.json @@ -30,5 +30,9 @@ } }, "size": "size value" , - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/addressesUsingIdsQuery/no_layers.json b/test/fixtures/addressesUsingIdsQuery/no_layers.json index 22acc61..89c1b2d 100644 --- a/test/fixtures/addressesUsingIdsQuery/no_layers.json +++ b/test/fixtures/addressesUsingIdsQuery/no_layers.json @@ -96,5 +96,9 @@ } }, "size": "size value" , - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/addressesUsingIdsQuery/no_layers_with_boosts.json b/test/fixtures/addressesUsingIdsQuery/no_layers_with_boosts.json index 3b67b77..caf0974 100644 --- a/test/fixtures/addressesUsingIdsQuery/no_layers_with_boosts.json +++ b/test/fixtures/addressesUsingIdsQuery/no_layers_with_boosts.json @@ -65,5 +65,9 @@ } }, "size": "size value" , - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/addressesUsingIdsQuery/unit_no_housenumber.json b/test/fixtures/addressesUsingIdsQuery/unit_no_housenumber.json index 7ef55af..64cbb7e 100644 --- a/test/fixtures/addressesUsingIdsQuery/unit_no_housenumber.json +++ b/test/fixtures/addressesUsingIdsQuery/unit_no_housenumber.json @@ -30,5 +30,9 @@ } }, "size": "size value", - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/addressesUsingIdsQuery/with_filters.json b/test/fixtures/addressesUsingIdsQuery/with_filters.json index 8746f4c..541a6e1 100644 --- a/test/fixtures/addressesUsingIdsQuery/with_filters.json +++ b/test/fixtures/addressesUsingIdsQuery/with_filters.json @@ -75,5 +75,9 @@ } }, "size": "size value" , - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/addressesUsingIdsQuery/with_layers.json b/test/fixtures/addressesUsingIdsQuery/with_layers.json index 57fafb6..601fa8b 100644 --- a/test/fixtures/addressesUsingIdsQuery/with_layers.json +++ b/test/fixtures/addressesUsingIdsQuery/with_layers.json @@ -80,5 +80,9 @@ } }, "size": "size value" , - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/addressesUsingIdsQuery/with_layers_and_filters.json b/test/fixtures/addressesUsingIdsQuery/with_layers_and_filters.json index 22695a3..57309b9 100644 --- a/test/fixtures/addressesUsingIdsQuery/with_layers_and_filters.json +++ b/test/fixtures/addressesUsingIdsQuery/with_layers_and_filters.json @@ -80,5 +80,9 @@ } }, "size": "size value" , - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/addressesUsingIdsQuery/with_scores.json b/test/fixtures/addressesUsingIdsQuery/with_scores.json index 8b2caca..4aba359 100644 --- a/test/fixtures/addressesUsingIdsQuery/with_scores.json +++ b/test/fixtures/addressesUsingIdsQuery/with_scores.json @@ -67,5 +67,9 @@ } }, "size": "size value" , - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/fallbackQuery1.json b/test/fixtures/fallbackQuery1.json index 18ec92d..4124953 100644 --- a/test/fixtures/fallbackQuery1.json +++ b/test/fixtures/fallbackQuery1.json @@ -768,6 +768,7 @@ "size": "size value", "track_scores": "track_scores value", "sort": [ - "_score" + "_score", + "_id" ] } diff --git a/test/fixtures/fallbackQuery2.json b/test/fixtures/fallbackQuery2.json index a62d02c..a6f42cc 100644 --- a/test/fixtures/fallbackQuery2.json +++ b/test/fixtures/fallbackQuery2.json @@ -672,6 +672,7 @@ "size": "size value", "track_scores": "track_scores value", "sort": [ - "_score" + "_score", + "_id" ] } diff --git a/test/fixtures/fallbackQuery_address_with_postcode.json b/test/fixtures/fallbackQuery_address_with_postcode.json index 9ed3d3c..7530fff 100644 --- a/test/fixtures/fallbackQuery_address_with_postcode.json +++ b/test/fixtures/fallbackQuery_address_with_postcode.json @@ -101,6 +101,7 @@ "size": "size value", "track_scores": "track_scores value", "sort": [ - "_score" + "_score", + "_id" ] } diff --git a/test/fixtures/fallbackQuery_neighbourhood_only.json b/test/fixtures/fallbackQuery_neighbourhood_only.json index 285bec8..09d6751 100644 --- a/test/fixtures/fallbackQuery_neighbourhood_only.json +++ b/test/fixtures/fallbackQuery_neighbourhood_only.json @@ -36,6 +36,7 @@ "size": "size value", "track_scores": "track_scores value", "sort": [ - "_score" + "_score", + "_id" ] } diff --git a/test/fixtures/fallbackQuery_nothing_set.json b/test/fixtures/fallbackQuery_nothing_set.json index d631ccd..11fef03 100644 --- a/test/fixtures/fallbackQuery_nothing_set.json +++ b/test/fixtures/fallbackQuery_nothing_set.json @@ -16,6 +16,7 @@ "size": "size value", "track_scores": "track_scores value", "sort": [ - "_score" + "_score", + "_id" ] } diff --git a/test/fixtures/structuredFallbackQuery/address.json b/test/fixtures/structuredFallbackQuery/address.json index 1602305..933f366 100644 --- a/test/fixtures/structuredFallbackQuery/address.json +++ b/test/fixtures/structuredFallbackQuery/address.json @@ -679,6 +679,7 @@ "size": "size value", "track_scores": "track_scores value", "sort": [ - "_score" + "_score", + "_id" ] } diff --git a/test/fixtures/structuredFallbackQuery/address_with_postcode.json b/test/fixtures/structuredFallbackQuery/address_with_postcode.json index ea8600b..8993ea1 100644 --- a/test/fixtures/structuredFallbackQuery/address_with_postcode.json +++ b/test/fixtures/structuredFallbackQuery/address_with_postcode.json @@ -101,6 +101,7 @@ "size": "size value", "track_scores": "track_scores value", "sort": [ - "_score" + "_score", + "_id" ] } diff --git a/test/fixtures/structuredFallbackQuery/housenumber.json b/test/fixtures/structuredFallbackQuery/housenumber.json index a692ec0..d3153b1 100644 --- a/test/fixtures/structuredFallbackQuery/housenumber.json +++ b/test/fixtures/structuredFallbackQuery/housenumber.json @@ -38,6 +38,7 @@ "size": "size value", "track_scores": "track_scores value", "sort": [ - "_score" + "_score", + "_id" ] } diff --git a/test/fixtures/structuredFallbackQuery/locality_as_borough.json b/test/fixtures/structuredFallbackQuery/locality_as_borough.json index fb7ece7..ef91eb4 100644 --- a/test/fixtures/structuredFallbackQuery/locality_as_borough.json +++ b/test/fixtures/structuredFallbackQuery/locality_as_borough.json @@ -163,6 +163,7 @@ "size": "size value", "track_scores": "track_scores value", "sort": [ - "_score" + "_score", + "_id" ] } diff --git a/test/fixtures/structuredFallbackQuery/query.json b/test/fixtures/structuredFallbackQuery/query.json index 17a7e35..abdf963 100644 --- a/test/fixtures/structuredFallbackQuery/query.json +++ b/test/fixtures/structuredFallbackQuery/query.json @@ -762,6 +762,7 @@ "size": "size value", "track_scores": "track_scores value", "sort": [ - "_score" + "_score", + "_id" ] } diff --git a/test/fixtures/venuesQuery/base_render.json b/test/fixtures/venuesQuery/base_render.json index a211ae0..28a4a0b 100644 --- a/test/fixtures/venuesQuery/base_render.json +++ b/test/fixtures/venuesQuery/base_render.json @@ -29,5 +29,9 @@ } }, "size": "size value" , - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/venuesQuery/with_filters.json b/test/fixtures/venuesQuery/with_filters.json index 0acdf85..8c91c18 100644 --- a/test/fixtures/venuesQuery/with_filters.json +++ b/test/fixtures/venuesQuery/with_filters.json @@ -35,5 +35,9 @@ } }, "size": "size value" , - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/fixtures/venuesQuery/with_scores.json b/test/fixtures/venuesQuery/with_scores.json index c492295..c7ea5ef 100644 --- a/test/fixtures/venuesQuery/with_scores.json +++ b/test/fixtures/venuesQuery/with_scores.json @@ -33,5 +33,9 @@ } }, "size": "size value" , - "track_scores": "track_scores value" + "track_scores": "track_scores value", + "sort": [ + "_score", + "_id" + ] } diff --git a/test/layout/FilteredBooleanQuery.js b/test/layout/FilteredBooleanQuery.js index 98f71b9..72baca6 100644 --- a/test/layout/FilteredBooleanQuery.js +++ b/test/layout/FilteredBooleanQuery.js @@ -19,7 +19,7 @@ module.exports.tests.base_render = function(test, common) { }, size: { $: 'size value' }, track_scores: { $: 'track_scores value' }, - sort: ['_score'] + sort: ['_score', '_id'] }; t.deepEquals(actual, expected); @@ -94,7 +94,7 @@ module.exports.tests.scores = function(test, common) { }, size: { $: 'size value' }, track_scores: { $: 'track_scores value' }, - sort: ['_score'] + sort: ['_score', '_id'] }; t.deepEquals(actual, expected); @@ -127,7 +127,7 @@ module.exports.tests.scores = function(test, common) { }, size: { $: 'size value' }, track_scores: { $: 'track_scores value' }, - sort: ['_score'] + sort: ['_score', '_id'] }; t.deepEquals(actual, expected); @@ -160,7 +160,7 @@ module.exports.tests.scores = function(test, common) { }, size: { $: 'size value' }, track_scores: { $: 'track_scores value' }, - sort: ['_score'] + sort: ['_score', '_id'] }; t.deepEquals(actual, expected); @@ -204,7 +204,7 @@ module.exports.tests.scores = function(test, common) { }, size: { $: 'size value' }, track_scores: { $: 'track_scores value' }, - sort: ['_score'] + sort: ['_score', '_id'] }; t.equals(score_views_called, 8); @@ -254,7 +254,7 @@ module.exports.tests.filter = function(test, common) { }, size: { $: 'size value' }, track_scores: { $: 'track_scores value' }, - sort: ['_score'] + sort: ['_score', '_id'] }; t.equals(filter_views_called, 8); @@ -299,7 +299,7 @@ module.exports.tests.sort = function(test, common) { size: { $: 'size value' }, track_scores: { $: 'track_scores value' }, sort: [ - '_score', + '_score', '_id', { 'sort field 1': 'sort value 1'}, { 'sort field 2': 'sort value 2'} ]