Hi <@U01NZ4D0LDD> I am using below search ```<http...
# community-help
b
Hi @Jason Bosco I am using below search
Copy code
<https://xxxxxxxxxxxxx.typesense.net/multi_search?query_by=sku,brand,description>
{
    "searches": [
        {
            "collection": "nic-items",
            "q": "-R - ",
            "page": 1,
            "per_page": 250,
            "include_fields": "id,sku,description,categoryName,brand,packSizeDescription"
        }
    ]
}
However I don't get all fields that are mentioned in include_fields This is what we get
j
Are all those fields present in all the documents?
b
will that matter, one document could have brand, but not other one, we created some of the fields as optional in collection schema
j
I meant to say, does that particular example document you shared have those fields? If it does, could you DM me your cluster ID? I can take a closer look
b
Copy code
if [[ $# -eq 3 && $1 == 'get-single-document' ]]
then
    curl "${TYPE_SENSE_HOSTURL}/collections/${2}/documents/${3}" \
                                             -X GET \
                                             -H "X-TYPESENSE-API-KEY: ${TYPE_SENSE_API_MASTER_KEY}"
                                             
fi
This one gives me more than one documents
Am I missing anything
This is the exported JSONL
j
Will take a look in about 15 mins
b
Thanks
j
In the JSON response you shared, I do see other fields for that SKU
b
Let me check
I might have been missing something very basic
Thanks Jason, you know what happened. I was using a JSON formatter in VS Code, I found on whatever file I do format, it kept bringing a file from cache, Then I started investigating other collection, which is a small test collection. And I found the root cause of that stupid extension
😄 1
😅 1
Thank you very much
👍 1
Once quick question I have, if you don't mind. In multi-search POST method, is it mandatory to send
query_by
The GET search without query_by works .
${TYPE_SENSE_HOSTURL}/collections/${2}/documents/search?q=*&page=1&per_page=250&exclude_fields=images,salesSheet
j
For
q=*
queries,
query_by
is not required. Otherwise it is required
b
got it thanks
👍 1