Browse Source

Merge pull request #335 from pelias/remove_tiebreakers

remove all references to tiebreaking groovy scripts
pull/341/head
Peter Johnson a.k.a. insertcoffee 9 years ago
parent
commit
f06fe8880f
  1. 5
      query/search.js
  2. 2
      test/unit/fixture/search_linguistic_bbox.js
  3. 2
      test/unit/fixture/search_linguistic_focus.js
  4. 2
      test/unit/fixture/search_linguistic_focus_bbox.js
  5. 2
      test/unit/fixture/search_linguistic_focus_null_island.js
  6. 25
      test/unit/fixture/sort_default.js
  7. 11
      test/unit/query/search.js

5
query/search.js

@ -37,11 +37,6 @@ query.score( peliasQuery.view.admin('neighborhood') );
query.filter( peliasQuery.view.boundary_circle );
query.filter( peliasQuery.view.boundary_rect );
// groovy scripts used to handle tie-breaking
query.sort( peliasQuery.view.sort_numeric_script('admin_boost') );
query.sort( peliasQuery.view.sort_numeric_script('popularity') );
query.sort( peliasQuery.view.sort_numeric_script('population') );
// --------------------------------
/**

2
test/unit/fixture/search_linguistic_bbox.js

@ -102,7 +102,7 @@ module.exports = {
}
}
},
'sort': [ '_sort' ],
'sort': [ '_score' ],
'size': 10,
'track_scores': true
};

2
test/unit/fixture/search_linguistic_focus.js

@ -116,7 +116,7 @@ module.exports = {
}
}
},
'sort': [ '_sort' ],
'sort': [ '_score' ],
'size': 10,
'track_scores': true
};

2
test/unit/fixture/search_linguistic_focus_bbox.js

@ -132,7 +132,7 @@ module.exports = {
}
}
},
'sort': [ '_sort' ],
'sort': [ '_score' ],
'size': 10,
'track_scores': true
};

2
test/unit/fixture/search_linguistic_focus_null_island.js

@ -116,7 +116,7 @@ module.exports = {
}
}
},
'sort': [ '_sort' ],
'sort': [ '_score' ],
'size': 10,
'track_scores': true
};

25
test/unit/fixture/sort_default.js

@ -1,25 +0,0 @@
module.exports = [
'_score',
{
'_script': {
'file': 'admin_boost',
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'file': 'popularity',
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'file': 'population',
'type': 'number',
'order': 'desc'
}
}
];

11
test/unit/query/search.js

@ -10,8 +10,6 @@ module.exports.tests.interface = function(test, common) {
});
};
var sort = require('../fixture/sort_default');
module.exports.tests.query = function(test, common) {
test('valid search + focus + bbox', function(t) {
var query = generate({
@ -26,7 +24,6 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_linguistic_focus_bbox');
expected.sort = sort;
t.deepEqual(compiled, expected, 'valid search query');
t.end();
@ -44,7 +41,6 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_linguistic_bbox');
expected.sort = sort;
t.deepEqual(compiled, expected, 'valid search query');
t.end();
@ -58,7 +54,6 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_linguistic_only');
expected.sort = sort;
t.deepEqual(compiled, expected, 'valid search query');
t.end();
@ -73,7 +68,6 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_linguistic_focus');
expected.sort = sort;
t.deepEqual(compiled, expected, 'valid search query');
t.end();
@ -88,7 +82,6 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_linguistic_focus_null_island');
expected.sort = sort;
t.deepEqual(compiled, expected, 'valid search query');
t.end();
@ -105,7 +98,6 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_full_address');
expected.sort = sort;
t.deepEqual(compiled, expected, 'valid search query');
t.end();
@ -122,7 +114,6 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_partial_address');
expected.sort = sort;
t.deepEqual(compiled, expected, 'valid search query');
t.end();
@ -139,7 +130,6 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_regions_address');
expected.sort = sort;
t.deepEqual(compiled, expected, 'valid search query');
t.end();
@ -154,7 +144,6 @@ module.exports.tests.query = function(test, common) {
var compiled = JSON.parse( JSON.stringify( query ) );
var expected = require('../fixture/search_boundary_country');
expected.sort = sort;
t.deepEqual(compiled, expected, 'valid boundary.country query');
t.end();

Loading…
Cancel
Save