@seekora-ai/search-sdk 0.2.18 → 0.2.19
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/package.json +1 -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,
|