Scott Nei
05/06/2025, 7:29 PMAlan Martini
05/06/2025, 8:50 PMWillie
05/06/2025, 8:54 PMAlan Martini
05/06/2025, 9:40 PMAlan Martini
05/06/2025, 9:40 PMScott Nei
05/07/2025, 7:22 PMcurl --location '<https://yuke>...-1.a1.typesense.net/collections/products_prod/documents/search?q=42750&query_by=barcodes%2Cskus%2Cmanufacturer.mfrNumbers%2Cdescription%2CsupplierDescriptions&query_by_weights=100%2C100%2C100%2C100%2C100' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-US,en;q=0.9' \
--header 'origin: <https://app.abc.com>' \
--header 'priority: u=1, i' \
--header 'referer: <https://app.abc.com/productSearch=42750>' \
--header 'sec-ch-ua: "Google Chrome";v="135", "Not-A.Brand";v="8", "Chromium";v="135"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "Windows"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: cross-site' \
--header 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36' \
--header 'x-typesense-api-key: abc'
cURL 2:
curl --location '<https://yuke>...-1.a1.typesense.net/collections/products_prod/documents/search?q=42750&query_by=barcodes%2Cmanufacturer.mfrNumbers%2Cskus%2Cdescription%2CsupplierDescriptions&query_by_weights=100%2C100%2C100%2C100%2C100' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-US,en;q=0.9' \
--header 'origin: <https://app.abc.com>' \
--header 'priority: u=1, i' \
--header 'referer: <https://app.abc.com/productSearch=42750>' \
--header 'sec-ch-ua: "Google Chrome";v="135", "Not-A.Brand";v="8", "Chromium";v="135"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "Windows"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: cross-site' \
--header 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36' \
--header 'x-typesense-api-key: abc'
Alan Martini
05/07/2025, 7:24 PMScott Nei
05/08/2025, 2:02 PMAlan Martini
05/08/2025, 4:28 PMquery_by_weights
itself, but rather in query_by
. Changing the order of itens in it seems to change the results. The team is actively investigating the root cause.
The concatenated approach you mentioned is a good work around for now!Scott Nei
05/08/2025, 4:57 PMScott Nei
05/09/2025, 11:45 AMAlan Martini
05/09/2025, 5:32 PMAlan Martini
05/09/2025, 9:15 PMmax_candidates
parameter to 100
should yield the expected results. Here’s more info on the max_candidates parameter.
It looks like the order of the query_by
values is affecting the default value (4
) of max_candidates
some way, which we're looking into separately.Scott Nei
05/10/2025, 12:42 PMAlan Martini
05/10/2025, 4:08 PMAlan Martini
05/10/2025, 4:14 PM--------------------------------
Querying '42750' skus with max_candidates
Amount of hits: 77
--------------------------------
Querying '42750' description with max_candidates
Amount of hits: 15
--------------------------------
Querying '42750' skus,description with max_candidates
Amount of hits: 92
--------------------------------
Querying '42750' description,skus with max_candidates
Amount of hits: 92
If you can share the code snippet your app is using, I can help debug it with you.Scott Nei
05/12/2025, 1:23 PMAlan Martini
05/12/2025, 9:45 PMmax_candidates
is set to 4, and this value applies across all fields listed in query_by
. That means once 4 candidates are found in total, the search stops, and priority is given based on the order of fields in query_by
.
So when you set the weights to 100,120,100
, you were explicitly boosting the second field, which caused Typesense to prioritize it—leading to the results you saw.
Given the structure of your dataset, adjusting max_candidates
is the right move. The way it's currently working aligns with how the system is designed.