@findlane/server 0.20.0 → 0.21.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/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -386,6 +386,11 @@ export type SearchRequest = {
|
|
|
386
386
|
/** Contexts the page sends, which rules with a `context` condition fire on, such as "category-page": a
|
|
387
387
|
* name or up to 10, each 1 to 64 letters, digits, `_`, `:` or `-` (0.20.0). */
|
|
388
388
|
context?: string | string[];
|
|
389
|
+
/** Records matching these filters come first, after the index's rank first, in searches by relevance: filters as
|
|
390
|
+
* `filters` takes them, or a list of up to 10, each counting once, so records matching more come first (0.21.0). */
|
|
391
|
+
boost?: SearchRequest["filters"] | SearchRequest["filters"][];
|
|
392
|
+
/** Records matching these come last, the same way (0.21.0). */
|
|
393
|
+
bury?: SearchRequest["filters"] | SearchRequest["filters"][];
|
|
389
394
|
/** Checks rules as at this time, in milliseconds since 1970, such as a campaign's start, instead of now
|
|
390
395
|
* (0.20.0). Browser search doesn't take it. */
|
|
391
396
|
rulesAt?: number;
|
|
@@ -458,6 +463,14 @@ export type AppliedRule = {
|
|
|
458
463
|
id: string;
|
|
459
464
|
userData?: unknown;
|
|
460
465
|
};
|
|
466
|
+
/** A rule's banner: an image, where it links, its text, its place among the hits from 1, and the rule's ID. */
|
|
467
|
+
export type Banner = {
|
|
468
|
+
image: string;
|
|
469
|
+
link?: string;
|
|
470
|
+
title?: string;
|
|
471
|
+
position?: number;
|
|
472
|
+
rule: string;
|
|
473
|
+
};
|
|
461
474
|
export type SearchResponse<T> = {
|
|
462
475
|
hits: {
|
|
463
476
|
id: string;
|
|
@@ -512,6 +525,11 @@ export type SearchResponse<T> = {
|
|
|
512
525
|
appliedRules?: AppliedRule[];
|
|
513
526
|
/** When a rule replaced words: the query that was searched. */
|
|
514
527
|
rewrittenQuery?: string;
|
|
528
|
+
/** Banners of the rules that fired, in their order (0.21.0): show each at its `position` among the hits (from
|
|
529
|
+
* 1; the top when left out), linking to `link`. */
|
|
530
|
+
banners?: Banner[];
|
|
531
|
+
/** A page a rule sends this search to, such as "/pages/returns" (0.21.0): go there instead of showing results. */
|
|
532
|
+
redirect?: string;
|
|
515
533
|
/** With the index's `relatedResults` on (0.18.0): when the query's words found nothing (`hits` empty,
|
|
516
534
|
* `total` 0), the products closest to it in meaning, best first, with their similarity as `score`. Show
|
|
517
535
|
* them under a heading of their own, such as "No exact matches. Related products". */
|
package/dist/index.d.ts
CHANGED
|
@@ -386,6 +386,11 @@ export type SearchRequest = {
|
|
|
386
386
|
/** Contexts the page sends, which rules with a `context` condition fire on, such as "category-page": a
|
|
387
387
|
* name or up to 10, each 1 to 64 letters, digits, `_`, `:` or `-` (0.20.0). */
|
|
388
388
|
context?: string | string[];
|
|
389
|
+
/** Records matching these filters come first, after the index's rank first, in searches by relevance: filters as
|
|
390
|
+
* `filters` takes them, or a list of up to 10, each counting once, so records matching more come first (0.21.0). */
|
|
391
|
+
boost?: SearchRequest["filters"] | SearchRequest["filters"][];
|
|
392
|
+
/** Records matching these come last, the same way (0.21.0). */
|
|
393
|
+
bury?: SearchRequest["filters"] | SearchRequest["filters"][];
|
|
389
394
|
/** Checks rules as at this time, in milliseconds since 1970, such as a campaign's start, instead of now
|
|
390
395
|
* (0.20.0). Browser search doesn't take it. */
|
|
391
396
|
rulesAt?: number;
|
|
@@ -458,6 +463,14 @@ export type AppliedRule = {
|
|
|
458
463
|
id: string;
|
|
459
464
|
userData?: unknown;
|
|
460
465
|
};
|
|
466
|
+
/** A rule's banner: an image, where it links, its text, its place among the hits from 1, and the rule's ID. */
|
|
467
|
+
export type Banner = {
|
|
468
|
+
image: string;
|
|
469
|
+
link?: string;
|
|
470
|
+
title?: string;
|
|
471
|
+
position?: number;
|
|
472
|
+
rule: string;
|
|
473
|
+
};
|
|
461
474
|
export type SearchResponse<T> = {
|
|
462
475
|
hits: {
|
|
463
476
|
id: string;
|
|
@@ -512,6 +525,11 @@ export type SearchResponse<T> = {
|
|
|
512
525
|
appliedRules?: AppliedRule[];
|
|
513
526
|
/** When a rule replaced words: the query that was searched. */
|
|
514
527
|
rewrittenQuery?: string;
|
|
528
|
+
/** Banners of the rules that fired, in their order (0.21.0): show each at its `position` among the hits (from
|
|
529
|
+
* 1; the top when left out), linking to `link`. */
|
|
530
|
+
banners?: Banner[];
|
|
531
|
+
/** A page a rule sends this search to, such as "/pages/returns" (0.21.0): go there instead of showing results. */
|
|
532
|
+
redirect?: string;
|
|
515
533
|
/** With the index's `relatedResults` on (0.18.0): when the query's words found nothing (`hits` empty,
|
|
516
534
|
* `total` 0), the products closest to it in meaning, best first, with their similarity as `score`. Show
|
|
517
535
|
* them under a heading of their own, such as "No exact matches. Related products". */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@findlane/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Findlane server SDK: upload catalogs, manage index settings, and search with a secret workspace API key.",
|
|
5
5
|
"keywords": ["findlane", "search", "full-text search", "typo tolerance", "ecommerce search", "search api", "sdk"],
|
|
6
6
|
"license": "MIT",
|