#community-help

Cache on Typesense and "amount" Field Issue

TLDR Max encountered a facet field error regarding the "amount" field. Kishore Nallan and James suggested checking the search query and setting "amount" as a facet: true in the schema.

Powered by Struct AI
Feb 06, 2023 (10 months ago)
Max
Photo of md5-0632b78a36980331a087faf672610530
Max
01:31 PM
Greetings, everyone 👋
Is there something like a cache on Typesense?
I swapped my index and I'm getting
Unhandled Rejection (Error): 404 - Could not find a facet field named `amount` in the schema.

Double checked all the code - there is no reference to amount anywhere else :man-shrugging:
01:32
Max
01:32 PM
  22 | try {
  23 |   typesenseResponse = await this._adaptAndPerformTypesenseRequest(instantsearchRequests);
  24 | 
> 25 |   const adaptedResponses = typesenseResponse.results.map((typesenseResult, index) => {
     | ^  26 |     this._validateTypesenseResult(typesenseResult);
  27 |     const responseAdapter = new SearchResponseAdapter(
  28 |       typesenseResult,
01:33
Max
01:33 PM
it breaks the app as soon the results are returned.
And results actually have amount field :thinking_face:
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:59 PM
Can you check the actual search query being sent?
James
Photo of md5-30d4fe895016bc91ebf1879acf690bab
James
01:59 PM
do you have that field marked as "facet: true"?
Max
Photo of md5-0632b78a36980331a087faf672610530
Max
02:00 PM
Checking...
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:00 PM
This error message happens if your search query has a facet_by=amount but that amount field is not marked as facet: true in the collection schema.
Max
Photo of md5-0632b78a36980331a087faf672610530
Max
02:01 PM
Interesting :thinking_face:
facet_by: "amount"

and it's quite possible that collection don't have item with that field.
Checking dashboard now 😅
02:03
Max
02:03 PM
Weird though that I don't set it anywhere in the code... 😅
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:18 PM
You’d have to set “amount” as facet: true in the Collection’s schema as well

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community

Similar Threads

Faceting issue with Products Collections in Typesense

Carl was unable to facet on a string array. Kishore Nallan and Jason advised ensuring facet counts were being returned and offered to assist in troubleshooting. Issue resolved upon Carl realizing no data was saved in the database.

4

13
29mo

Range Filtering and Faceting Discussion

Phil asked about the requirements for range filtering, which Jason explained does not always require faceting. Discussion about different possibilities with Algolia and Typesense ensued, resulting in Phil successfully utilizing the 'Configure' widget.

2

48
28mo

Query on Facet Values, `max_facet_values` , and `facet_query_num_typos`.

Jan asked about sorting facet values, managing `max_facet_values` and issues with `facet_query_num_typos`. Jason clarified the details on instantsearch widget handling of `max_facet_values` and identified a bug on the Typesense Server. Jason suggested a solution to the sorting issue.

2

23
1mo

Production Typesense Issue with Unexpected Filter Behavior

Ankit flagged a problem with a specific filter on the production server of Typesense. After several exchanges regarding optimisation and version checks, Kishore Nallan provided latest builds to troubleshoot. The filtering within facets issue persists and potential edge cases are being investigated.

5

53
3mo

Querying with Typesense-Js and Handling Null Values

michtio was querying using typesense-js and receiving fewer results than expected. Kishore Nallan suggested using different query parameters. Further discussion led to the handling of 'null' values and filtering syntax in the search queries. The thread ended with Jason offering migration support from Algolia to Typesense.

4

39
17mo