This guide will walk you through the process of setting up Meilisearch with OpenAI embeddings to enable semantic search capabilities.
text-embedding-3-large
: 3,072 dimensionstext-embedding-3-small
: 1,536 dimensionstext-embedding-ada-002
: 1,536 dimensionssource
: Specifies the source of the embedder, which is set to “openAi” for using OpenAI’s API.apiKey
: Replace <OpenAI API Key>
with your actual OpenAI API key.dimensions
: Specifies the dimensions of the embeddings. Set to 1536 for text-embedding-3-small
and text-embedding-ada-002
, or 3072 for text-embedding-3-large
.documentTemplate
: Optionally, you can provide a custom template for generating embeddings from your documents.model
: Specifies the OpenAI model to use for generating embeddings. Choose from text-embedding-3-large
, text-embedding-3-small
, or text-embedding-ada-002
.q
: Represents the user’s search query.hybrid
: Specifies the configuration for the hybrid search.
semanticRatio
: Allows you to control the balance between semantic search and traditional search. A value of 1 indicates pure semantic search, while a value of 0 represents full-text search. You can adjust this parameter to achieve a hybrid search experience.embedder
: The name of the embedder used for generating embeddings. Make sure to use the same name as specified in the embedder configuration, which in this case is “openai”.