AI-powered search uses LLMs to retrieve search results. This tutorial shows you how to configure an OpenAI embedder and perform your first search.
kitchenware
index and add this kitchenware products dataset to it. It will take Meilisearch a few moments to process your request, but you can continue to the next step while your data is indexing.
embedder
object:
products-openai
is the name of your embedder for this tutorial. You can name embedders any way you want, but try to keep it simple, short, and easy to remember.
source
field to your embedder object:
model
field to your embedder object:
text-embedding-3-small
is a cost-effective model for general usage.
apiKey
field to your embedder:
OPEN_AI_API_KEY
with your own API key.
documentTemplate
to your embedder:
An object used in a kitchen
. Then it adds the information that is specific to each document: doc
represents your document, and you can access any of its attributes using dot notation. name
is an attribute with values such as wooden spoon
or rolling pin
. Since it is present in all documents in this dataset and describes the product in few words, it is a good choice to include in the template.
MEILISEARCH_URL
with the address of your Meilisearch project, and OPEN_AI_API_KEY
with your OpenAI API key.
Meilisearch and OpenAI will start processing your documents and updating your index. This may take a few moments, but once it’s done you are ready to perform an AI-powered search.
/search
endpoint with a request containing both the q
and the hybrid
parameters:
hybrid
is an object with a single embedder
field.
Meilisearch will then return an equal mix of semantic and full-text matches.
hybrid
search parameter.