pelias-query
Advanced tools
Comparing version 9.2.0 to 9.3.0
@@ -1,1 +0,1 @@ | ||
{"name":"pelias-query","version":"9.2.0","description":"An Elasticsearch query builder for Pelias","engines":{"node":">=4.0.0"},"main":"index.js","scripts":{"lint":"jshint .","units":"node test/run.js | tap-spec","test":"npm run units","validate":"npm ls","travis":"npm run check-dependencies && npm run test","semantic-release":"semantic-release pre && npm publish && semantic-release post","check-dependencies":"node_modules/.bin/npm-check --production"},"repository":{"type":"git","url":"https://github.com/pelias/query.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/pelias/query/issues"},"homepage":"https://github.com/pelias/query#readme","dependencies":{"check-types":"^7.0.0","lodash":"^4.14.1"},"devDependencies":{"deep-diff":"^0.3.4","jshint":"^2.5.6","npm-check":"git://github.com/orangejulius/npm-check.git#disable-update-check","precommit-hook":"^3.0.0","tap-spec":"^4.1.0","tape":"^4.2.0","semantic-release":"^8.0.3"},"pre-commit":["lint","validate","test","check-dependencies"]} | ||
{"name":"pelias-query","version":"9.3.0","description":"An Elasticsearch query builder for Pelias","engines":{"node":">=4.0.0"},"main":"index.js","scripts":{"lint":"jshint .","units":"node test/run.js | tap-spec","test":"npm run units","validate":"npm ls","travis":"npm run check-dependencies && npm run test","semantic-release":"semantic-release pre && npm publish && semantic-release post","check-dependencies":"node_modules/.bin/npm-check --production"},"repository":{"type":"git","url":"https://github.com/pelias/query.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/pelias/query/issues"},"homepage":"https://github.com/pelias/query#readme","dependencies":{"check-types":"^7.0.0","lodash":"^4.14.1"},"devDependencies":{"deep-diff":"^0.3.4","jshint":"^2.5.6","npm-check":"git://github.com/orangejulius/npm-check.git#disable-update-check","precommit-hook":"^3.0.0","tap-spec":"^4.1.0","tape":"^4.2.0","semantic-release":"^8.0.3"},"pre-commit":["lint","validate","test","check-dependencies"]} |
@@ -66,2 +66,26 @@ var ngrams = require('../../view/ngrams'); | ||
module.exports.tests.fuzziness_variable = function(test, common) { | ||
test('fuzziness variable should be presented in query', function(t) { | ||
var store = getBaseVariableStore(); | ||
store.var('ngram:fuzziness', 'fuzziness value'); | ||
var actual = ngrams(store); | ||
var expected = { | ||
match: { | ||
'field value': { | ||
analyzer: { $: 'analyzer value' }, | ||
boost: { $: 'boost value' }, | ||
query: { $: 'name value' }, | ||
fuzziness: { $: 'fuzziness value' } | ||
} | ||
} | ||
}; | ||
t.deepEquals(actual, expected, 'should have returned object with fuzziness field'); | ||
t.end(); | ||
}); | ||
}; | ||
module.exports.all = function (tape, common) { | ||
@@ -68,0 +92,0 @@ function test(name, testFunction) { |
@@ -69,2 +69,29 @@ var phrase = require('../../view/phrase'); | ||
module.exports.tests.fuzziness_variable = function(test, common) { | ||
test('fuzziness variable should be presented in query', function(t) { | ||
var store = getBaseVariableStore(); | ||
store.var('phrase:fuzziness', 'fuzziness value'); | ||
var actual = phrase(store); | ||
var expected = { | ||
match: { | ||
'field value': { | ||
analyzer: { $: 'analyzer value' }, | ||
type: 'phrase', | ||
boost: { $: 'boost value' }, | ||
slop: { $: 'slop value' }, | ||
query: { $: 'name value' }, | ||
fuzziness: { $: 'fuzziness value' } | ||
} | ||
} | ||
}; | ||
t.deepEquals(actual, expected, 'should have returned object with fuzziness field'); | ||
t.end(); | ||
}); | ||
}; | ||
module.exports.all = function (tape, common) { | ||
@@ -71,0 +98,0 @@ function test(name, testFunction) { |
@@ -22,3 +22,7 @@ | ||
if (vs.isset('ngram:fuzziness')) { | ||
view.match[ vs.var('ngram:field') ].fuzziness = vs.var('ngram:fuzziness'); | ||
} | ||
return view; | ||
}; |
@@ -25,3 +25,7 @@ | ||
if (vs.isset('phrase:fuzziness')) { | ||
view.match[ vs.var('phrase:field') ].fuzziness = vs.var('phrase:fuzziness'); | ||
} | ||
return view; | ||
}; |
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
282217
8589