Complex Query System and Collections Schema for Typesense
TLDR Orion asks about the grammar for 'filter_by' search parameters and where to find a collections schema. Jason provides the needed documentation and encourages Orion to share back.
1
1
1
Jun 30, 2023 (5 months ago)
Orion
04:01 PMIs there a formal grammar for
filter_by
or any of the search parameters? I am working on a complex query system which takes a query language, validates and parses it, then constructs typesense queries from the syntax tree. Doing this without knowing the precise filtering grammar (or other params) is quite a challenge. At the moment I've taken all the documented examples and tried to formalise them into PEG and BNF grammars but I would love to be more confident that it matches.Second (much more mundane) question, is there any way to programmatically get a collections schema? I'm using the schema to inject some more intelligent behaviour into the query system so that things like filtering
tags[] > 5
throws a useful syntax error in the frontend. I can copy-paste the schema when it changes but I would really love to avoid that.Orion
04:12 PMJason
04:14 PMfilter_by
in this tableOrion
04:14 PMJason
04:15 PMYup. Using this GET endpoint
1
Orion
04:15 PMJason
04:16 PMOrion
04:17 PMOrion
04:22 PM1
Jason
04:22 PMOrion
04:23 PMOrion
04:23 PMJason
04:23 PMOrion
04:26 PMJason
04:30 PMOrion
04:31 PM1
Typesense
Indexed 3005 threads (79% resolved)
Similar Threads
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.
Resolving Typesense Analytics "top_queries" Collection Issue
Zain faced issues with typesense analytics and an empty "top_queries" collection. Jason and Kishore Nallan assisted in troubleshooting, identified a bug, and suggested a fix in `0.25.0.rc66`. The fix worked for Zain.
Issue with Search Duration on Typesense Database
Robert reported an issue about query time delay when adding a `filter_by` constraint in a large Typesense database. Kishore Nallan explained that this happens due to the order of operation and also promised to look into this issue further. Robert withdrew his interest in sponsoring the improvement due to moving from the project.
Solving Typesense Cloud Interface Issue in Python
Orion had an issue querying from Python in the Typesense Cloud interface. Kishore Nallan identified the problem within the array declaration. They then discussed improving error messages and Orion offered to make a PR.
Multiple Filters and JSON Requests in Typesense
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.