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 = [
'_score',
{
'_script': {
'file': admin_boost,
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'file': population,
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'file': popularity,
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'params': {
'category_weights': category_weights
},
'file': category,
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'params': {
'weights': weights
},
'file': 'weights',
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'params': {
'input': 'test'
},
'file': 'exact_match',
'type': 'number',
'order': 'desc'
function createExpectedQuery(){
var sort = [
'_score',
{
'_script': {
'file': admin_boost,
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'file': population,
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'file': popularity,
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'params': {
'category_weights': category_weights
},
'file': category,
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'params': {
'weights': weights
},
'file': 'weights',
'type': 'number',
'order': 'desc'
}
},
{
'_script': {
'params': {
'input': 'test'
},
'file': 'exact_match',
'type': 'number',
'order': 'desc'
}
}
}
];
];
function createExpectedQuery(){
return {
'query': {
'filtered': {

Loading…
Cancel
Save