This guide shows you what to do and what to avoid when writing a documentTemplate
.
documentTemplate
with each document’s data. The better your prompt is, the more relevant your search results.
This guide shows you what to do and what to avoid when writing a documentTemplate
.
documentTemplate
documentTemplate
value in your embedder configuration.
The default documentTemplate
includes all searchable fields with non-null
values. In most cases, this adds noise and more information than the embedder needs to provide relevant search results.
documentTemplate
for the sample document could be:
poster
and id
contain data that has little semantic importance and can be safely excluded. The data in genres
and release_date
is very useful for filters, but say little about this specific film.
This leaves two relevant fields: title
and overview
.
overview
alone is 49 words. Use Liquid’s truncate
or truncatewords
to shorten it.
Short prompts do not have enough information for the embedder to properly understand the query context. Long prompts instead provide too much information and make it hard for the embedder to identify what is truly relevant about a document.
documentTemplate