Athul
02/05/2025, 8:19 AM{
"q": "apple",
"page": 1,
"per_page": 50,
"query_by": "title, additionalCategories, sku",
"exclude_fields": "embedding",
"filter_by": "additionalCategories:=Promo Zone"
}
The dataset contains relevant data for the filter, but it's not returning any results.
By the way, additionalCategories
is a string[]
field.
However, I am getting results for the following query:
{
"q": "apple",
"page": 1,
"per_page": 50,
"query_by": "title, additionalCategories, sku",
"exclude_fields": "embedding",
"filter_by": "additionalCategories:=[\"Promo Zone\"]"
}
Any idea what could be causing this?Harpreet Sangar
02/05/2025, 8:28 AMquery_by
is missing.Harpreet Sangar
02/05/2025, 8:35 AMAthul
02/05/2025, 9:25 AMAthul
02/05/2025, 10:47 AMHarpreet Sangar
02/05/2025, 10:49 AMAthul
02/05/2025, 12:28 PMcurl "<http://localhost:8108/collections>" \
-X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"name": "products",
"fields": [
{"name": "title", "type": "string" },
{"name": "price", "type": "string", "sort": true },
{"name": "sale_price", "type": "string" },
{"name": "additionalCategories", "type": "string[]", "facet": true }
],
"default_sorting_field": "price"
}'
curl "<http://localhost:8108/multi_search>" \
-X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"searches": [
{
"collection": "products",
"q": "apple",
"query_by": "title",
"query_by": "title, additionalCategories",
"filter_by": "additionalCategories:=Promo Zone"
}
]
}'
Athul
02/06/2025, 3:29 AMHarpreet Sangar
02/06/2025, 6:43 AMAthul
02/06/2025, 8:24 AMHarpreet Sangar
02/06/2025, 4:06 PM"filter_by": "additionalCategories:=Promo Zone"
and "filter_by": "additionalCategories:=[\"Promo Zone\"]"
produce the same result.Harpreet Sangar
02/06/2025, 4:07 PM"found": 277