#community-help

Limiting Fields in Query Results using Instantsearch.js

TLDR Chetan asked if results from query could return specific fields in instantsearch.js. Jason suggested using exclude_fields search parameter.

Powered by Struct AI

1

5
3mo
Solved
Join the chat
Jul 05, 2023 (3 months ago)
Chetan
Photo of md5-f5bf390d5711f8a2f96bd93d1bc97d20
Chetan
08:00 PM
is there a way to only return specific fields when querying/searching? I'm getting all the vector embeddings back each query, which is unnecessary and just resulting in a slower experience for the user. I'm using instantsearch.js.
08:01
Chetan
08:01 PM
poked around the docs for the instant search adapter + the official API, but could have missed it
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
08:02 PM
You can add the embedding field to the exclude_fields search parameter
Chetan
Photo of md5-f5bf390d5711f8a2f96bd93d1bc97d20
Chetan
09:10 PM
ah awesome, i didn't realize additionalSearchParameters in the instantsearch adapter could accept all the normal search parameters - thanks Jason!

1