pelias-query
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -14,3 +14,3 @@ | ||
Layout.prototype.filter = function( view ){ | ||
this._filter.push([ view, 'must' ]); | ||
this._filter.push( view ); | ||
return this; | ||
@@ -43,11 +43,9 @@ }; | ||
if( this._filter.length ){ | ||
q.query.filtered.filter = { bool: {} }; | ||
this._filter.forEach( function( condition ){ | ||
var view = condition[0], operator = condition[1]; | ||
if( !q.query.filtered.filter.bool.hasOwnProperty( operator ) ){ | ||
q.query.filtered.filter.bool[ operator ] = []; | ||
} | ||
this._filter.forEach( function( view ){ | ||
var rendered = view( vs ); | ||
if( rendered ){ | ||
q.query.filtered.filter.bool[ operator ].push( rendered ); | ||
if( !q.query.filtered.hasOwnProperty( 'filter' ) ){ | ||
q.query.filtered.filter = { bool: { must: [] } }; | ||
} | ||
q.query.filtered.filter.bool.must.push( rendered ); | ||
} | ||
@@ -54,0 +52,0 @@ }); |
{ | ||
"name": "pelias-query", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
42233
928