Multiple Filters and JSON Requests in Typesense
TLDR Manish asked about multiple filter_by arguments, JSON input, and using multisearch. Jason offered typesense documentation links, examples, and how to use JSON formatted requests with multisearch. Ed shared a similar use case.
5
1
Jun 16, 2023 (6 months ago)
Manish
05:43 PMManish
05:43 PMJason
05:45 PMfilter_by: field1:=a && field2:=b
Jason
05:46 PMManish
05:46 PMJason
05:47 PMUnder “Multiple Conditions”
Manish
05:51 PMJason
05:52 PM1
Jason
05:52 PMJason
05:53 PMManish
05:58 PMJason
05:58 PMJason
05:59 PMManish
06:00 PMJason
06:00 PMManish
06:00 PMManish
06:14 PM1
Ed
09:15 PMI have a search query [free text], example Operations Manager
Filters: employment-type = ‘full-time’, job-type=‘remote’, country = ‘Germany’
these are all facets with counts on them.
Naturally when you pick a filter - example full time, the count for all other employment-types is set to 0. I need to be able to show the count for part-time aswell even though you clicked on ‘full-time’, also other filters now would reflect the total count, example, job-type now has only 10 full-time jobs that are of job-type = remote.
The idea is to send another query to get facet counts using existing query + filters, except for the ones you’re active on, example on the employment-type.
This query would look like this:
search: Operations Manager,
Filters: job-type = ‘remote’, country = ‘Germany’
You see I purposely didn’t include the ‘employment-type’ filter, this way it would me facet counts for full-time and part time.
Ed
09:15 PMJason
09:16 PMJason
09:16 PMIf you open the browser dev console, and then the network tab, then click on some of the filters, you’ll see the type of queries generated inside the multi-search request
Ed
09:17 PMJason
09:17 PMEd
09:17 PMEd
09:20 PMJason
09:22 PMJason
09:22 PMJason
09:23 PMJason
09:23 PMEd
09:24 PMEd
09:24 PM1
Ed
09:30 PMjust this could run on 2vCPU and 1GB memory?
Jason
09:31 PMEd
09:31 PMEd
09:31 PM1
Jun 20, 2023 (5 months ago)
Manish
02:40 PMquery_by
parameter is outside the JSON, while all the rest of them are within the JSON. Why?Jason
04:24 PMJason
04:24 PMManish
04:25 PMJason
04:25 PMManish
04:25 PMJason
04:26 PM1
Jason
04:26 PMManish
07:14 PM1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Discussing Typesense Search Request Performance
Al experienced longer-than-reported times for Typesense search requests, sparking a detailed examination of json parsing, response times and data transfer. Jason and Kishore Nallan helped solve the issue.
Moving from Algolia to Typesense: Questions and Answers
Juan sought advice from Kishore Nallan about moving from Algolia to Typesense, handling MultiSearch, setting parameters, checking imported documents, and a specific syntax query.
Enhancing Vector Search Performance and Response Time using Multi-Search Feature
Bill faced performance issues with vector search using multi_search feature. Jason and Kishore Nallan suggested running models on a GPU and excluding large fields from the search. Through discussion, it was established that adding more CPUs and enabling server-side caching could enhance performance. The thread concluded with the user reaching a resolution.
Improving Record Retrieval Speed from Typesense
Yoshi sought ways to accelerate Typesense record retrieval. Jason advised upgrading to high availability and using the documents/export endpoint. They also noted a high volume of writes consuming significant CPU capacity as a possible performance factor.
Integrating Semantic Search with Typesense
Krish wants to integrate a semantic search functionality with typesense but struggles with the limitations. Kishore Nallan provides resources, clarifications and workarounds to the raised issues.