typesense-instantsearch-adapter 2.5.0-1 → 2.5.0-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/dist/typesense-instantsearch-adapter.js +3 -1
- package/dist/typesense-instantsearch-adapter.js.map +1 -1
- package/dist/typesense-instantsearch-adapter.min.js +1 -1
- package/dist/typesense-instantsearch-adapter.min.js.map +1 -1
- package/index.d.ts +1 -0
- package/lib/Configuration.js +2 -0
- package/lib/Configuration.js.map +1 -1
- package/lib/SearchResponseAdapter.js +1 -1
- package/lib/SearchResponseAdapter.js.map +1 -1
- package/package.json +1 -1
- package/src/Configuration.js +2 -0
- package/src/SearchResponseAdapter.js +1 -1
|
@@ -2204,6 +2204,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2204
2204
|
var Configuration = /*#__PURE__*/function () {
|
|
2205
2205
|
function Configuration() {
|
|
2206
2206
|
var _this$server$cacheSea,
|
|
2207
|
+
_options$useHighlight,
|
|
2207
2208
|
_options$additionalSe,
|
|
2208
2209
|
_ref,
|
|
2209
2210
|
_this$additionalSearc,
|
|
@@ -2228,6 +2229,7 @@ var Configuration = /*#__PURE__*/function () {
|
|
|
2228
2229
|
}]
|
|
2229
2230
|
};
|
|
2230
2231
|
this.server.cacheSearchResultsForSeconds = (_this$server$cacheSea = this.server.cacheSearchResultsForSeconds) !== null && _this$server$cacheSea !== void 0 ? _this$server$cacheSea : 2 * 60;
|
|
2232
|
+
this.useHighlightV2Structure = (_options$useHighlight = options.useHighlightV2Structure) !== null && _options$useHighlight !== void 0 ? _options$useHighlight : true;
|
|
2231
2233
|
this.additionalSearchParameters = (_options$additionalSe = options.additionalSearchParameters) !== null && _options$additionalSe !== void 0 ? _options$additionalSe : {};
|
|
2232
2234
|
this.additionalSearchParameters.query_by = (_ref = (_this$additionalSearc = this.additionalSearchParameters.queryBy) !== null && _this$additionalSearc !== void 0 ? _this$additionalSearc : this.additionalSearchParameters.query_by) !== null && _ref !== void 0 ? _ref : "";
|
|
2233
2235
|
this.additionalSearchParameters.sort_by = (_ref2 = (_this$additionalSearc2 = this.additionalSearchParameters.sortBy) !== null && _this$additionalSearc2 !== void 0 ? _this$additionalSearc2 : this.additionalSearchParameters.sort_by) !== null && _ref2 !== void 0 ? _ref2 : "";
|
|
@@ -2856,7 +2858,7 @@ var SearchResponseAdapter = /*#__PURE__*/function () {
|
|
|
2856
2858
|
var result = {}; // If there is a highlight object available (as of v0.24.0),
|
|
2857
2859
|
// use that instead of the highlights array, since it supports highlights of nested fields
|
|
2858
2860
|
|
|
2859
|
-
if (typesenseHit.highlight != null) {
|
|
2861
|
+
if (this.configuration.useHighlightV2Structure === true && typesenseHit.highlight != null) {
|
|
2860
2862
|
this.adaptHighlightObject(typesenseHit, result, snippetOrValue);
|
|
2861
2863
|
} else {
|
|
2862
2864
|
this.adaptHighlightsArray(typesenseHit, result, snippetOrValue);
|