Gauthier PLM
08/27/2025, 9:24 AMpreset
field be embedded in a search API key?
I tried and it seems other parameters are properly taken into account by Typesense, but defining a preset
(which contains the query_by
for the collection) in my API key does not seem to work. Typesense reports that no search fields are in the query.
If I set the preset
field on the query (not the API key), it works as expected.Kishore Nallan
08/27/2025, 11:08 AMpreset
field should be embeddable, just like any other search parameter. Can you produce a small reproducible example that shows the issue?Gauthier PLM
08/27/2025, 3:31 PMquery_by
and collection
params, along with an exclude_fields
2. send the key to the front end
3. in the front end, do a multisearch with the preset
and q
parameters.Gauthier PLM
08/27/2025, 3:36 PM{
"preset": "companies-search-preset",
"q": "sales",
"page": 1,
"per_page": 10
}
This is the preset:
{
"collection": "companies",
"query_by": "name,thematics.label,segments.label"
}
This is how I generate the key:
{
preset: `companies-search-preset`,
exclude_fields: ["restricted_users"],
}
Kishore Nallan
08/27/2025, 3:38 PMGauthier PLM
08/27/2025, 3:40 PMGauthier PLM
08/27/2025, 3:48 PM{
"0": {
"code": 400,
"error": "No search fields specified for the query."
}
}
Gauthier PLM
08/27/2025, 3:49 PMKishore Nallan
08/27/2025, 5:30 PMpreset
embedded. Then I created a preset with the same name that had a query_by field definiton. Then I hit the multi_search API with the scoped API key in one of the search parameters and search works fine without errors.Kishore Nallan
08/27/2025, 5:32 PMquery_by
param
3. Create a scoped api key with the preset embedded
4. Try querying that collection with the scoped api keyGauthier PLM
08/28/2025, 11:06 AMKishore Nallan
08/28/2025, 11:41 AMGauthier PLM
09/04/2025, 3:35 PMGauthier PLM
09/04/2025, 3:36 PMKishore Nallan
09/04/2025, 4:25 PMKishore Nallan
09/04/2025, 4:25 PM