Browse Source

Move sort array into createExpectedQuery().

test/unit/query/search.js
	-The fact that it's a singleton was causing problems because at
	least one of the tests directly modifies it (this was one of the
	reasons why the base query itself was moved into
	`createExpectedQuery()`).
	-Move it into `createExpectedQuery()` as well.
search-suggest-categories
Severyn Kozak 10 years ago
parent
commit
7462e6bc80
  1. 108
      test/unit/query/search.js

108
test/unit/query/search.js

@ -16,62 +16,62 @@ module.exports.tests.interface = function(test, common) {
}); });
}; };
var sort = [ function createExpectedQuery(){
'_score', var sort = [
{ '_score',
'_script': { {
'file': admin_boost, '_script': {
'type': 'number', 'file': admin_boost,
'order': 'desc' 'type': 'number',
} 'order': 'desc'
}, }
{ },
'_script': { {
'file': population, '_script': {
'type': 'number', 'file': population,
'order': 'desc' 'type': 'number',
} 'order': 'desc'
}, }
{ },
'_script': { {
'file': popularity, '_script': {
'type': 'number', 'file': popularity,
'order': 'desc' 'type': 'number',
} 'order': 'desc'
}, }
{ },
'_script': { {
'params': { '_script': {
'category_weights': category_weights 'params': {
}, 'category_weights': category_weights
'file': category, },
'type': 'number', 'file': category,
'order': 'desc' 'type': 'number',
} 'order': 'desc'
}, }
{ },
'_script': { {
'params': { '_script': {
'weights': weights 'params': {
}, 'weights': weights
'file': 'weights', },
'type': 'number', 'file': 'weights',
'order': 'desc' 'type': 'number',
} 'order': 'desc'
}, }
{ },
'_script': { {
'params': { '_script': {
'input': 'test' 'params': {
}, 'input': 'test'
'file': 'exact_match', },
'type': 'number', 'file': 'exact_match',
'order': 'desc' 'type': 'number',
'order': 'desc'
}
} }
} ];
];
function createExpectedQuery(){
return { return {
'query': { 'query': {
'filtered': { 'filtered': {

Loading…
Cancel
Save