This guide shows you how to use the similar documents endpoint to create an AI-powered movie recommendation workflow.
movies
and add this movies.json
dataset to it. If necessary, consult the getting started for more instructions on index creation.
Each document in the dataset represents a single movie and has the following structure:
id
: a unique identifier for each document in the databasetitle
: the title of the movieoverview
: a brief summary of the movie’s plotgenres
: an array of genres associated with the movieposter
: a URL to the movie’s poster imagerelease_date
: the release date of the movie, represented as a Unix timestamp/settings/embedders
API subroute to configure your embedder:
Replace MEILISEARCH_URL
, MEILISEARCH_API_KEY
, and OPENAI_API_KEY
with the corresponding values in your application.
Meilisearch will start generating the embeddings for all movies in your dataset. Use the returned taskUid
to track the progress of this task. Once it is finished, you are ready to start searching.
id
field. In this case, it’s the movie “Batman” with id
192.
id
to your index’s /similar
route, specifying movies-text
as your embedder:
Meilisearch will return a list of the 20 documents most similar to the movie you chose. You may then choose to display some of these similar results to your users, pointing them to other movies that may also interest them.