Hi, I have a filter query, but it's returning a nu...
# community-help
a
Hi, I have a filter query, but it's returning a null result:
Copy code
{
  "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:
Copy code
{
  "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?
h
In the first query
query_by
is missing.
You should check the response for any errors.
If there's no error, can you provide a sample document that we can use to reproduce the issue?
a
Hi @Harpreet Sangar Here is the dataset.
Hi @Harpreet Sangar, did you reproduced it?
h
Not yet. Can you share the curl commands like https://gist.github.com/jasonbosco/7c3432713216c378472f13e72246f46b that showcase the issue?
a
Copy code
curl "<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"
            }
          ]
        }'
Hi @Jason Bosco @Harpreet Sangar @Kishore Nallan, could someone please help me resolve this issue?
h
I'm facing some issues with the build process. I'll let you know any updates.
a
@Harpreet Sangar Looking forward to your updates!
h
I'm unable to reproduce the issue. Both
"filter_by": "additionalCategories:=Promo Zone"
and
"filter_by": "additionalCategories:=[\"Promo Zone\"]"
produce the same result.
Both return
"found": 277