@seekora-ai/search-sdk 0.2.18 → 0.2.20
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/client.js +42 -2
- package/dist/generated/api.d.ts +8 -8
- package/package.json +2 -1
package/dist/client.js
CHANGED
|
@@ -171,7 +171,7 @@ class SeekoraClient {
|
|
|
171
171
|
// Log API request start
|
|
172
172
|
this.logger.verbose('Sending search API request', {
|
|
173
173
|
endpoint: '/api/v1/search',
|
|
174
|
-
method: '
|
|
174
|
+
method: 'POST',
|
|
175
175
|
storeId: this.storeId
|
|
176
176
|
});
|
|
177
177
|
// Build headers with personalization support
|
|
@@ -189,7 +189,47 @@ class SeekoraClient {
|
|
|
189
189
|
if (this.sessionId) {
|
|
190
190
|
headers['x-session-id'] = this.sessionId;
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
// Use POST to avoid URL length limits with complex filters/facets
|
|
193
|
+
const response = await this.searchApi.v1SearchPost(this.storeId, this.readSecret, {
|
|
194
|
+
q: searchRequest.q,
|
|
195
|
+
page: searchRequest.page,
|
|
196
|
+
per_page: searchRequest.per_page,
|
|
197
|
+
sort: searchRequest.sort,
|
|
198
|
+
filter: searchRequest.filter,
|
|
199
|
+
facet_by: searchRequest.facet_by,
|
|
200
|
+
max_facet_values: searchRequest.max_facet_values,
|
|
201
|
+
widget_mode: searchRequest.widget_mode,
|
|
202
|
+
include_suggestions: searchRequest.include_suggestions,
|
|
203
|
+
suggestions_limit: searchRequest.suggestions_limit,
|
|
204
|
+
analytics_tags: Array.isArray(searchRequest.analytics_tags) ? searchRequest.analytics_tags : undefined,
|
|
205
|
+
stopword_sets: Array.isArray(searchRequest.stopword_sets) ? searchRequest.stopword_sets : undefined,
|
|
206
|
+
synonym_sets: Array.isArray(searchRequest.synonym_sets) ? searchRequest.synonym_sets : undefined,
|
|
207
|
+
search_fields: searchRequest.search_fields,
|
|
208
|
+
return_fields: searchRequest.return_fields,
|
|
209
|
+
omit_fields: searchRequest.omit_fields,
|
|
210
|
+
snippet_fields: searchRequest.snippet_fields,
|
|
211
|
+
full_snippet_fields: searchRequest.full_snippet_fields,
|
|
212
|
+
field_weights: searchRequest.field_weights,
|
|
213
|
+
group_field: searchRequest.group_field,
|
|
214
|
+
group_size: searchRequest.group_size,
|
|
215
|
+
snippet_prefix: searchRequest.snippet_prefix,
|
|
216
|
+
snippet_suffix: searchRequest.snippet_suffix,
|
|
217
|
+
snippet_token_limit: searchRequest.snippet_token_limit,
|
|
218
|
+
snippet_min_len: searchRequest.snippet_min_len,
|
|
219
|
+
include_snippets: searchRequest.include_snippets,
|
|
220
|
+
prefix_mode: searchRequest.prefix_mode,
|
|
221
|
+
infix_mode: searchRequest.infix_mode,
|
|
222
|
+
typo_max: searchRequest.typo_max,
|
|
223
|
+
typo_min_len_1: searchRequest.typo_min_len_1,
|
|
224
|
+
typo_min_len_2: searchRequest.typo_min_len_2,
|
|
225
|
+
search_timeout_ms: searchRequest.search_timeout_ms,
|
|
226
|
+
require_all_terms: searchRequest.require_all_terms,
|
|
227
|
+
exact_match_boost: searchRequest.exact_match_boost,
|
|
228
|
+
cache_results: searchRequest.cache_results,
|
|
229
|
+
apply_rules: searchRequest.apply_rules,
|
|
230
|
+
preset_name: searchRequest.preset_name,
|
|
231
|
+
facet_search_text: searchRequest.facet_search_text,
|
|
232
|
+
}, this.userId, this.anonId, this.sessionId, { headers });
|
|
193
233
|
// Log API response received
|
|
194
234
|
this.logger.verbose('Search API response received', {
|
|
195
235
|
status: response.status,
|
package/dist/generated/api.d.ts
CHANGED
|
@@ -139,7 +139,7 @@ export interface DataTypesComponentCheck {
|
|
|
139
139
|
}
|
|
140
140
|
export interface DataTypesComponentStatusDetail {
|
|
141
141
|
/**
|
|
142
|
-
*
|
|
142
|
+
* Search collection exists
|
|
143
143
|
*/
|
|
144
144
|
'collection'?: DataTypesComponentCheck;
|
|
145
145
|
/**
|
|
@@ -246,7 +246,7 @@ export interface DataTypesDropdownRecommendationsConfig {
|
|
|
246
246
|
*/
|
|
247
247
|
'dynamic_tabs_max_count'?: number;
|
|
248
248
|
/**
|
|
249
|
-
* Method: \"groupBy\" (
|
|
249
|
+
* Method: \"groupBy\" (group results by field), \"facets\" (uses facet discovery), \"manual\" (uses FilteredTabs config only) (default: \"groupBy\")
|
|
250
250
|
*/
|
|
251
251
|
'dynamic_tabs_method'?: string;
|
|
252
252
|
/**
|
|
@@ -917,13 +917,13 @@ export interface DataTypesQuerySuggestionsConfig {
|
|
|
917
917
|
*/
|
|
918
918
|
'min_popularity'?: number;
|
|
919
919
|
/**
|
|
920
|
-
* Whether
|
|
920
|
+
* Whether the search collection is enabled for suggestions
|
|
921
921
|
*/
|
|
922
|
-
'
|
|
922
|
+
'search_index_enabled'?: boolean;
|
|
923
923
|
/**
|
|
924
|
-
* Whether to sync to
|
|
924
|
+
* Whether to sync enabled suggestions to the search engine
|
|
925
925
|
*/
|
|
926
|
-
'
|
|
926
|
+
'sync_to_index'?: boolean;
|
|
927
927
|
/**
|
|
928
928
|
* Include auto-generated suggestions
|
|
929
929
|
*/
|
|
@@ -1976,9 +1976,9 @@ export interface QuerySuggestionsServiceUpdateSuggestionConfigRequest {
|
|
|
1976
1976
|
*/
|
|
1977
1977
|
'stemming_locale'?: string;
|
|
1978
1978
|
/**
|
|
1979
|
-
* Enable/disable syncing suggestions to
|
|
1979
|
+
* Enable/disable syncing suggestions to the search engine
|
|
1980
1980
|
*/
|
|
1981
|
-
'
|
|
1981
|
+
'sync_to_index'?: boolean;
|
|
1982
1982
|
/**
|
|
1983
1983
|
* Typo tolerance
|
|
1984
1984
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seekora-ai/search-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20",
|
|
4
4
|
"description": "Seekora Search SDK for JavaScript/TypeScript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"winston": "^3.11.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
+
"@changesets/cli": "^2.31.0",
|
|
44
45
|
"@types/node": "^20.0.0",
|
|
45
46
|
"esbuild": "^0.19.12",
|
|
46
47
|
"typescript": "^5.0.0"
|