Trouble with 'q' Parameter in Typesense query
TLDR ryosuke_shiomi was having trouble with a Typesense query involving the 'q' parameter. Kishore Nallan suggested a temporary workaround and proposed using the latest builds to fix the issue. The solution was under trial at the end of the thread.
Mar 11, 2022 (20 months ago)
ryosuke_shiomi
07:14 AMKishore Nallan
07:24 AMquery_by
clause requires a list of fields, but I see that in your query you have -${userId1} -${userId2} -${userId3} …
which is strange.ryosuke_shiomi
07:29 AMIn exactly,
const searchParams = {
q: "-${userId1} -${userId2} -${userId3} …",
query_by: "userId",
filter_by: "favoriteGame: APEX"
}
Kishore Nallan
07:34 AMuserId
field? Is it an array of user IDs or just a single user ID?ryosuke_shiomi
07:38 AMschema is it (it is not all params because the app is not mine, is my office’s.)
collection 'users'
userId: string
favGame: string
createdAt: Date(int)
Kishore Nallan
07:40 AMryosuke_shiomi
07:42 AMKishore Nallan
07:43 AMq: "*",
filter_by: "favoriteGame: APEX && userId:!= [${userId1}, ${userId2}, ${userId3}]"
ryosuke_shiomi
07:44 AMAfter I try it, i would report the result.
Kishore Nallan
07:59 AMryosuke_shiomi
08:13 AMI tried the answer, but returned error.
what is the ‘facet field’?
results: [
{
code: 400,
error: 'To perform exclude filtering, filter field `userId` must be a facet field.'
}
]
Kishore Nallan
08:16 AMuserId
field need to have facet: true
enabled in the schema for negation. You don't need this if the latest RC builds work.ryosuke_shiomi
08:16 AMso I will try to use it.
Kishore Nallan
08:26 AMq
field, if you use the 0.23 RC builds, the bug you faced earlier won't be there.ryosuke_shiomi
08:30 AMso, please give me the information about how to use 0.23.
Kishore Nallan
08:41 AMryosuke_shiomi
11:59 AMKishore Nallan
12:14 PMTypesense
Indexed 2779 threads (79% resolved)
Similar Threads
Fixing Multiple Document Retrieval in Typesense
Phil needed an efficient way to retrieve multiple documents by id. Kishore Nallan proposed a solution available in a pre-release build. After some bug fixing regarding id matching by Jason and Kishore Nallan, Phil successfully tested the solution.
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.
Trouble with Query Negations on Typesense Search
em1nos was having troubles with query negations in Typesense search. Jason and Kishore Nallan assisted, suggesting em1nos reproduce the issue on a smaller dataset. Eventually, Kishore Nallan reproduced the problem on an earlier build but confirmed its resolution in a later one.
Resolving Multilingual Search Function in Typesense Software
Bill is having difficulty with multilingual search functionality in Typesense software. Developer Kishore Nallan suggested setting a language locale and provided a demo build. The build solution had some issues, and after multiple rounds of software updates and troubleshooting, the problem still persists.
Phrase Search Relevancy and Weights Fix
Jan reported an issue with phrase search relevancy using Typesense Instantsearch Adapter. The problem occurred when searching phrases with double quotes. The team identified the issue to be related to weights and implemented a fix, improving the search results.