pelias-query
Advanced tools
Comparing version 9.10.0 to 9.11.0
{ | ||
"name": "pelias-query", | ||
"version": "9.10.0", | ||
"version": "9.11.0", | ||
"description": "An Elasticsearch query builder for Pelias", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -94,2 +94,36 @@ var multi_match = require('../../view/multi_match'); | ||
module.exports.tests.type = function (test, common) { | ||
test('optional type', function (t) { | ||
var vs = new VariableStore(); | ||
vs.var('query var', 'query value'); | ||
vs.var('multi_match:type', 'cross_fields'); | ||
var fields_with_boosts = [ | ||
{ field: 'field 1' }, | ||
{ field: 'field 2' }, | ||
{ field: 'field 3' } | ||
]; | ||
var actual = multi_match(vs, fields_with_boosts, 'analyzer value', 'query var'); | ||
var expected = { | ||
multi_match: { | ||
fields: [ | ||
'field 1^1', | ||
'field 2^1', | ||
'field 3^1' | ||
], | ||
query: { $: 'query value' }, | ||
analyzer: 'analyzer value', | ||
type: { $: 'cross_fields' }, | ||
} | ||
}; | ||
t.deepEquals(actual, expected, 'should have returned object'); | ||
t.end(); | ||
}); | ||
}; | ||
module.exports.all = function (tape, common) { | ||
@@ -96,0 +130,0 @@ function test(name, testFunction) { |
@@ -34,2 +34,6 @@ /*** | ||
if (vs.isset('multi_match:type')) { | ||
view.multi_match.type = vs.var('multi_match:type'); | ||
} | ||
if (vs.isset('multi_match:cutoff_frequency')) { | ||
@@ -36,0 +40,0 @@ view.multi_match.cutoff_frequency = vs.var('multi_match:cutoff_frequency'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
303016
9277