This message was deleted.
# community-help
s
This message was deleted.
j
It should work. Could you share the full multi_search post body and your collection schema?
a
This one is the simplest multi_search post body
Collection schema
{
"created_at": 1692782291,
"default_sorting_field": "",
"enable_nested_fields": false,
"fields": [
{
"facet": true,
"index": true,
"infix": false,
"locale": "",
"name": "videoId",
"optional": false,
"sort": false,
"type": "string"
},
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "text",
"optional": false,
"sort": false,
"type": "string"
},
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "startTime",
"optional": false,
"sort": true,
"type": "int64"
},
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "acl",
"optional": false,
"sort": false,
"type": "string[]"
},
{
"embed": {
"from": [
"text"
],
"model_config": {
"api_key": "sk-**********************************************",
"model_name": "openai/text-embedding-ada-002"
}
},
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "embedding",
"num_dim": 1536,
"optional": false,
"sort": false,
"type": "float[]"
}
],
"name": "transcript_plots",
"num_documents": 296,
"symbols_to_index": [],
"token_separators": []
}
j
Hmm, this seems to work for me. For eg, try this from one of our demos:
Copy code
curl -s 'https://qtg5aekc2iosjh93p.a1.typesense.net/multi_search?x-typesense-api-key=8hLCPSQTYcBuK29zY5q6Xhin7ONxHy99' \
--data-binary '
{
  "searches": [
    {
      "query_by": "name,categories,description",
      "exclude_fields": "vectors",
      "collection": "products",
      "q": "phone",
      "per_page": 1
    }
  ]
}
' | jq
If you remove the
exclude_fields
parameter it will then return the vectors. Could you give me a set of curl commands like this that creates a sample collection, indexes one document, and does a search query that replicates the issue?
a
Ah it seems to be working here , after more digging the issue seems to be when performing a multi search with a scoped search key , the excluded fields param is not working
Do we have to specify about excluded_fields in scoped search keys before generating them ??
j
If you have
exclude_fields
inside a scoped API key, that will override the search parameter set outside the scoped API key
But if you haven't specified exclude_fields inside the scoped API key, then specifying it as a regular search param should work
a
exclude fields param doesn’t seem to be to be working like for scoped search keys tho it does work for search and admin keys in our current type sense instance . Is it a known issue ?
j
Hmm no, it's not. Could you give me a set of curl commands like this that creates a sample collection, indexes one document, creates a sample scoped API key and does a search query that replicates the issue?
a
Sure , just give me a bit
I think I found our issue , but just to cross check if we use exclude_fields in the scoped keys it would override the parameter (embedding) in the search and it wouldn't count
j
That's correct
Any parameters mentioned inside a scoped key has higher precedence