Skip to content

Commit 5c3543a

Browse files
committed
Support for colons in field values, support for special characters in numeric field names.
#82 (comment)
1 parent 234a2e9 commit 5c3543a

12 files changed

+482
-69
lines changed

README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,54 @@ const typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
398398
});
399399
```
400400

401+
### Special characters in field names / values
402+
403+
- If any string fields in your documents have a colon `:` in their values (for eg, let's say there's a field called `{ brand: "a:b" }`, then you would need to add a parameter like below when instantiating the adapter:
404+
405+
```js
406+
const typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
407+
server: {
408+
apiKey: "xyz",
409+
nodes: [
410+
{
411+
host: "localhost",
412+
port: "8108",
413+
path: "/",
414+
protocol: "http",
415+
},
416+
],
417+
},
418+
facetableFieldsWithSpecialCharacters: ["brand"], // <======= Add string fields that have colons in their values here, to aid in parsing
419+
additionalSearchParameters,
420+
});
421+
```
422+
423+
- If any numeric field _names_ in your documents have special characters like `>`, `<`, `=` (for eg, let's say there's a field called `{ price>discount: 3.0 }`) then you would need to add a parameter like below when instantiating the adapter:
424+
425+
```js
426+
const typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
427+
server: {
428+
apiKey: "xyz",
429+
nodes: [
430+
{
431+
host: "localhost",
432+
port: "8108",
433+
path: "/",
434+
protocol: "http",
435+
},
436+
],
437+
},
438+
facetableFieldsWithSpecialCharacters: ["price>discount"], // // <======= Add numeric fields that have >, < or = in their names, to aid in parsing
439+
additionalSearchParameters,
440+
});
441+
```
442+
401443
Read more about all available options for `renderingContent` in [Algolia's documentation here](https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/?client=javascript#examples).
402444

403445
## Compatibility
404446

405447
| Typesense Server | typesense-instantsearch-adapter | instantsearch.js | react-instantsearch | vue-instantsearch | angular-instantsearch |
406-
|------------------|---------------------------------| ---------------- | ------------------- | ----------------- | --------------------- |
448+
| ---------------- | ------------------------------- | ---------------- | ------------------- | ----------------- | --------------------- |
407449
| \>= v0.25.0.rc14 | \>= v2.7.0-1 | \>= 4.51 | \>= 6.39 | \>= 4.8 | \>= 4.4 |
408450
| \>= v0.25.0.rc12 | \>= v2.6.0 | \>= 4.51 | \>= 6.39 | \>= 4.8 | \>= 4.4 |
409451
| \>= v0.24 | \>= v2.5.0 | \>= 4.2.0 | \>= 6.0.0 | \>= 2.2.1 | \>= 3.0.0 |

dist/typesense-instantsearch-adapter.js

Lines changed: 130 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/typesense-instantsearch-adapter.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/typesense-instantsearch-adapter.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/typesense-instantsearch-adapter.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Configuration.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)