Is it possible to have a field in the "query_by" p...
# community-help
s
Is it possible to have a field in the "query_by" parameter as well as the "exclude_fields" parameter? I have very large documents, but I don't want to return the entire text of the document, only the snippet.
k
Yes, that's allowed.
s
Hmm I'm not sure what I'm doing wrong. Here is what I'm trying to pass in for my parameter.
q: this.search,
query_by: "text",
highlight_affix_num_tokens: 20,
exclude_fields: 'text'
The response returns highlights as empty. Am I missing something?
*highlights*: []
k
By default excluded fields are also excluded from highlights. You can send an explicit list of fields to be highlighted via
highlight_fields
param.
💯 1
🙌 1
s
Thank you! That fixed it!
🙌 1