pelias-query
Advanced tools
Comparing version 9.14.1 to 9.15.0
{ | ||
"name": "pelias-query", | ||
"version": "9.14.1", | ||
"version": "9.15.0", | ||
"description": "An Elasticsearch query builder for Pelias", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -114,2 +114,26 @@ var ngrams = require('../../view/ngrams'); | ||
module.exports.tests.minimum_should_match = function(test, common) { | ||
test('minimum_should_match variable should be presented in query', function(t) { | ||
var store = getBaseVariableStore(); | ||
store.var('ngram:minimum_should_match', 'minimum_should_match value'); | ||
var actual = ngrams(store); | ||
var expected = { | ||
match: { | ||
'field value': { | ||
analyzer: { $: 'analyzer value' }, | ||
boost: { $: 'boost value' }, | ||
query: { $: 'name value' }, | ||
minimum_should_match: { $: 'minimum_should_match value' } | ||
} | ||
} | ||
}; | ||
t.deepEquals(actual, expected, 'should have returned object with minimum_should_match field'); | ||
t.end(); | ||
}); | ||
}; | ||
module.exports.all = function (tape, common) { | ||
@@ -116,0 +140,0 @@ function test(name, testFunction) { |
@@ -30,3 +30,7 @@ | ||
if (vs.isset('ngram:minimum_should_match')) { | ||
view.match[ vs.var('ngram:field') ].minimum_should_match = vs.var('ngram:minimum_should_match'); | ||
} | ||
return view; | ||
}; |
308619
9488