algoliasearch-helper
Advanced tools
Comparing version 2.1.0 to 2.1.1
{ | ||
"name": "algoliasearch-helper", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"homepage": "https://github.com/algolia/algoliasearch-helper-js", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -38,3 +38,3 @@ "use strict"; | ||
*/ | ||
algoliasearchHelper.version = "2.1.0"; | ||
algoliasearchHelper.version = "2.1.1"; | ||
@@ -41,0 +41,0 @@ /** |
{ | ||
"name": "algoliasearch-helper", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Helper for implementing advanced search features with algolia", | ||
@@ -18,11 +18,6 @@ "main": "index.js", | ||
"doc:watch" : "onchange 'src/**/*.js' 'index.js' -- npm run doc", | ||
"publish-doc": "git checkout gh-pages && git merge master && npm run build && npm run doc && git commit -a -m 'Update doc' && git push origin gh-pages && git checkout master", | ||
"publish-doc": "git checkout gh-pages && git merge master && npm run build && npm run doc && git add docs dist && git commit -a -m 'Update doc' && git push origin gh-pages && git checkout master", | ||
"test-ci": "echo \"Error: no test specified\" && exit 1", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"browserify": { | ||
"transform": [ | ||
"envify" | ||
] | ||
}, | ||
"author": { | ||
@@ -29,0 +24,0 @@ "name": "Algolia SAS", |
@@ -533,2 +533,3 @@ "use strict"; | ||
AlgoliaSearchHelper.prototype._getHitsSearchParams = function() { | ||
var query = this.state.query; | ||
var facets = this.state.facets.concat( this.state.disjunctiveFacets ); | ||
@@ -541,6 +542,6 @@ var facetFilters = this._getFacetFilters(); | ||
tagFilters : tagFilters, | ||
distinct : this.state.distinct || false | ||
distinct : this.state.distinct | ||
}; | ||
if( !this.state.query && facetFilters.length === 0 && numericFilters.length === 0 && tagFilters.length === 0 ) { | ||
if( !this.containsRefinement( query, facetFilters, numericFilters, tagFilters ) ) { | ||
additionalParams.distinct = false; | ||
@@ -567,2 +568,3 @@ } | ||
AlgoliaSearchHelper.prototype._getDisjunctiveFacetSearchParams = function( facet ) { | ||
var query = this.state.query; | ||
var facetFilters = this._getFacetFilters( facet ); | ||
@@ -579,6 +581,6 @@ var numericFilters = this._getNumericFilters( facet ); | ||
tagFilters : tagFilters, | ||
distinct : this.state.distinct || false | ||
distinct : this.state.distinct | ||
}; | ||
if( !this.state.query && facetFilters.length === 0 && numericFilters.length === 0 && tagFilters.length === 0 ) { | ||
if( !this.containsRefinement( query, facetFilters, numericFilters, tagFilters ) ) { | ||
additionalParams.distinct = false; | ||
@@ -598,2 +600,9 @@ } | ||
AlgoliaSearchHelper.prototype.containsRefinement = function( query, facetFilters, numericFilters, tagFilters ) { | ||
return query || | ||
facetFilters.length !== 0 || | ||
numericFilters.length !== 0 || | ||
tagFilters.length !== 0; | ||
}; | ||
/** | ||
@@ -600,0 +609,0 @@ * Return the numeric filters in an algolia request fashion |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
78236
17
1815