@usereactify/search 4.2.2 → 4.2.5-beta.0

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 CHANGED
@@ -2,6 +2,20 @@
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.4](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.2.3...v4.2.4) (2022-06-23)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * add missing spread operator ([acc51cb](https://bitbucket.org/usereactify/reactify-search-ui/commit/acc51cb5c414831e3d0e919185d076895903d837))
11
+
12
+ ### [4.2.3](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.2.2...v4.2.3) (2022-06-23)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * include sorting by collection position when using global curation ([141c463](https://bitbucket.org/usereactify/reactify-search-ui/commit/141c46351711c3cff65275e47fdf8e9ed64b0ad8))
18
+
5
19
  ### [4.2.2](https://bitbucket.org/usereactify/reactify-search-ui/compare/v4.2.1...v4.2.2) (2022-06-21)
6
20
 
7
21
 
@@ -18,6 +18,7 @@ exports.Filter = void 0;
18
18
  const react_1 = __importDefault(require("react"));
19
19
  const MultiList_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/list/MultiList"));
20
20
  const SingleList_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/list/SingleList"));
21
+ const SingleRange_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/range/SingleRange"));
21
22
  const hooks_1 = require("../hooks");
22
23
  const FilterList_1 = require("./FilterList");
23
24
  const hooks_2 = require("../hooks");
@@ -30,6 +31,9 @@ const Filter = (props) => {
30
31
  if ("multi" === filter.displayType) {
31
32
  return (react_1.default.createElement(MultiList_1.default, Object.assign({ showCheckbox: false }, reactiveFilterListProps, { render: (reactivesearchFilterProps) => (react_1.default.createElement(FilterListInner, Object.assign({}, props, { reactivesearchFilterProps: reactivesearchFilterProps }))) })));
32
33
  }
34
+ if ("range" === filter.displayType) {
35
+ return (react_1.default.createElement(SingleRange_1.default, Object.assign({ showRadio: false }, reactiveFilterListProps)));
36
+ }
33
37
  console.log(`filter with display type "${filter.displayType}" not yet supported`);
34
38
  return null;
35
39
  };
@@ -70,7 +70,10 @@ const buildSort = (args) => {
70
70
  }
71
71
  const sorts = [];
72
72
  // show pins first
73
- if (!globalCuration)
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, sort by elastic score or index order
119
- // using index order ensures a consistent output order for queries which don't really
120
- // use a relevance score like collections
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
- else
126
+ }
127
+ // finally, for search, sort by score
128
+ if ("search" === curation.type) {
124
129
  sorts.push("_score");
125
- // @todo ideally, once pins are extinguished and there are no boost rules, the rest of the
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
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@usereactify/search",
3
3
  "description": "React UI library for Reactify Search",
4
- "version": "4.2.2",
4
+ "version": "4.2.5-beta.0",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",