algoliasearch-helper 3.22.5 → 3.22.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/algoliasearch.helper.js +18 -20
- package/dist/algoliasearch.helper.js.map +5 -5
- package/dist/algoliasearch.helper.min.js +2 -2
- package/dist/algoliasearch.helper.min.js.map +1 -1
- package/index.d.ts +6 -0
- package/package.json +2 -2
- package/src/SearchParameters/RefinementList.js +1 -1
- package/src/SearchParameters/index.js +0 -3
- package/src/SearchResults/index.js +15 -14
- package/src/version.js +1 -1
|
@@ -604,7 +604,7 @@ var lib = {
|
|
|
604
604
|
|
|
605
605
|
mod[attribute] = facetRefinement;
|
|
606
606
|
|
|
607
|
-
return defaultsPure(
|
|
607
|
+
return defaultsPure(mod, refinementList);
|
|
608
608
|
},
|
|
609
609
|
/**
|
|
610
610
|
* Removes refinement(s) for an attribute:
|
|
@@ -1952,7 +1952,6 @@ SearchParameters.prototype = {
|
|
|
1952
1952
|
|
|
1953
1953
|
return this.setQueryParameters({
|
|
1954
1954
|
hierarchicalFacetsRefinements: defaultsPure(
|
|
1955
|
-
{},
|
|
1956
1955
|
mod,
|
|
1957
1956
|
this.hierarchicalFacetsRefinements
|
|
1958
1957
|
),
|
|
@@ -1980,7 +1979,6 @@ SearchParameters.prototype = {
|
|
|
1980
1979
|
mod[facet] = [path];
|
|
1981
1980
|
return this.setQueryParameters({
|
|
1982
1981
|
hierarchicalFacetsRefinements: defaultsPure(
|
|
1983
|
-
{},
|
|
1984
1982
|
mod,
|
|
1985
1983
|
this.hierarchicalFacetsRefinements
|
|
1986
1984
|
),
|
|
@@ -2001,7 +1999,6 @@ SearchParameters.prototype = {
|
|
|
2001
1999
|
mod[facet] = [];
|
|
2002
2000
|
return this.setQueryParameters({
|
|
2003
2001
|
hierarchicalFacetsRefinements: defaultsPure(
|
|
2004
|
-
{},
|
|
2005
2002
|
mod,
|
|
2006
2003
|
this.hierarchicalFacetsRefinements
|
|
2007
2004
|
),
|
|
@@ -2638,7 +2635,6 @@ var fv = require('../functions/escapeFacetValue');
|
|
|
2638
2635
|
var find = require('../functions/find');
|
|
2639
2636
|
var findIndex = require('../functions/findIndex');
|
|
2640
2637
|
var formatSort = require('../functions/formatSort');
|
|
2641
|
-
var merge = require('../functions/merge');
|
|
2642
2638
|
var orderBy = require('../functions/orderBy');
|
|
2643
2639
|
var escapeFacetValue = fv.escapeFacetValue;
|
|
2644
2640
|
var unescapeFacetValue = fv.unescapeFacetValue;
|
|
@@ -2876,12 +2872,9 @@ function SearchResults(state, results, options) {
|
|
|
2876
2872
|
});
|
|
2877
2873
|
|
|
2878
2874
|
// Make every key of the result options reachable from the instance
|
|
2879
|
-
var opts =
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
},
|
|
2883
|
-
options
|
|
2884
|
-
);
|
|
2875
|
+
var opts = defaultsPure(options, {
|
|
2876
|
+
persistHierarchicalRootCount: false,
|
|
2877
|
+
});
|
|
2885
2878
|
Object.keys(opts).forEach(function (key) {
|
|
2886
2879
|
self[key] = opts[key];
|
|
2887
2880
|
});
|
|
@@ -3148,11 +3141,16 @@ function SearchResults(state, results, options) {
|
|
|
3148
3141
|
return;
|
|
3149
3142
|
}
|
|
3150
3143
|
|
|
3151
|
-
self.hierarchicalFacets[position][attributeIndex].data =
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3144
|
+
self.hierarchicalFacets[position][attributeIndex].data =
|
|
3145
|
+
self.persistHierarchicalRootCount
|
|
3146
|
+
? defaultsPure(
|
|
3147
|
+
self.hierarchicalFacets[position][attributeIndex].data,
|
|
3148
|
+
facetResults
|
|
3149
|
+
)
|
|
3150
|
+
: defaultsPure(
|
|
3151
|
+
facetResults,
|
|
3152
|
+
self.hierarchicalFacets[position][attributeIndex].data
|
|
3153
|
+
);
|
|
3156
3154
|
} else {
|
|
3157
3155
|
position = disjunctiveFacetsIndices[dfacet];
|
|
3158
3156
|
|
|
@@ -3161,7 +3159,7 @@ function SearchResults(state, results, options) {
|
|
|
3161
3159
|
|
|
3162
3160
|
self.disjunctiveFacets[position] = {
|
|
3163
3161
|
name: dfacet,
|
|
3164
|
-
data: defaultsPure(
|
|
3162
|
+
data: defaultsPure(dataFromMainRequest, facetResults),
|
|
3165
3163
|
exhaustive: result.exhaustiveFacetsCount,
|
|
3166
3164
|
};
|
|
3167
3165
|
assignFacetStats(
|
|
@@ -3559,7 +3557,7 @@ SearchResults.prototype.getFacetValues = function (attribute, opts) {
|
|
|
3559
3557
|
return undefined;
|
|
3560
3558
|
}
|
|
3561
3559
|
|
|
3562
|
-
var options = defaultsPure(
|
|
3560
|
+
var options = defaultsPure(opts, {
|
|
3563
3561
|
sortBy: SearchResults.DEFAULT_SORT,
|
|
3564
3562
|
// if no sortBy is given, attempt to sort based on facetOrdering
|
|
3565
3563
|
// if it is given, we still allow to sort via facet ordering first
|
|
@@ -3791,7 +3789,7 @@ function getHierarchicalRefinement(state, attributeName, name, resultsFacets) {
|
|
|
3791
3789
|
|
|
3792
3790
|
module.exports = SearchResults;
|
|
3793
3791
|
|
|
3794
|
-
},{"../functions/compact":11,"../functions/defaultsPure":12,"../functions/escapeFacetValue":13,"../functions/find":14,"../functions/findIndex":15,"../functions/formatSort":17,"../functions/
|
|
3792
|
+
},{"../functions/compact":11,"../functions/defaultsPure":12,"../functions/escapeFacetValue":13,"../functions/find":14,"../functions/findIndex":15,"../functions/formatSort":17,"../functions/orderBy":23,"./generate-hierarchical-tree":8}],10:[function(require,module,exports){
|
|
3795
3793
|
'use strict';
|
|
3796
3794
|
|
|
3797
3795
|
var EventEmitter = require('@algolia/events');
|
|
@@ -6726,7 +6724,7 @@ module.exports = sortAndMergeRecommendations;
|
|
|
6726
6724
|
},{"../functions/find":14,"../functions/flat":16}],28:[function(require,module,exports){
|
|
6727
6725
|
'use strict';
|
|
6728
6726
|
|
|
6729
|
-
module.exports = '3.22.
|
|
6727
|
+
module.exports = '3.22.6';
|
|
6730
6728
|
|
|
6731
6729
|
},{}]},{},[2])(2)
|
|
6732
6730
|
});
|