@usereactify/search 4.2.2 → 4.2.3
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/CHANGELOG.md +7 -0
- package/dist/sensor/SensorSort.js +12 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [4.2.3](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.2.2...v4.2.3) (2022-06-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* include sorting by collection position when using global curation ([141c463](https://bitbucket.org/usereactify/reactify-search-ui/commit/141c46351711c3cff65275e47fdf8e9ed64b0ad8))
|
|
11
|
+
|
|
5
12
|
### [4.2.2](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.2.1...v4.2.2) (2022-06-21)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -70,7 +70,10 @@ const buildSort = (args) => {
|
|
|
70
70
|
}
|
|
71
71
|
const sorts = [];
|
|
72
72
|
// show pins first
|
|
73
|
-
if (
|
|
73
|
+
if (globalCuration && collection) {
|
|
74
|
+
sorts.push(mapCollectionPositionSortClause(collection));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
74
77
|
sorts.push({
|
|
75
78
|
"curations.position": {
|
|
76
79
|
unmapped_type: "long",
|
|
@@ -89,6 +92,7 @@ const buildSort = (args) => {
|
|
|
89
92
|
},
|
|
90
93
|
},
|
|
91
94
|
});
|
|
95
|
+
}
|
|
92
96
|
if (0 < curation.boosting.groupings.length) {
|
|
93
97
|
const groupings = curation.boosting.groupings.sort((a, b) => a.position > b.position ? 1 : -1);
|
|
94
98
|
for (const grouping of groupings) {
|
|
@@ -115,16 +119,15 @@ const buildSort = (args) => {
|
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
|
-
// finally,
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
if ("collection" === curation.type)
|
|
122
|
+
// finally, for collections, if no other sorting is defined, sort by index order to provide
|
|
123
|
+
// a consistent order
|
|
124
|
+
if ("collection" === curation.type && sorts.length === 0) {
|
|
122
125
|
sorts.push("_doc");
|
|
123
|
-
|
|
126
|
+
}
|
|
127
|
+
// finally, for search, sort by score
|
|
128
|
+
if ("search" === curation.type) {
|
|
124
129
|
sorts.push("_score");
|
|
125
|
-
|
|
126
|
-
// result should be ordered by the shopify collection position rather than the index order,
|
|
127
|
-
// but this will need some proper testing to ensure it does not break curations
|
|
130
|
+
}
|
|
128
131
|
return sorts;
|
|
129
132
|
};
|
|
130
133
|
/**
|