db/meilisearch
A Meilisearch client: indexes, documents, full text, faceted, hybrid and federated search, settings, tasks and API keys.
import db.meilisearch
- Tutorial: a movie search in eleven steps
- 1. Connect
- 2. Create an index and add documents
- 3. Search
- 4. Filter, sort and count facets
- 5. Highlight, crop and page through results
- 6. Tune relevancy
- 7. Search several indexes at once
- 8. Vector and hybrid search
- 9. API keys and tenant tokens
- 10. Update and delete documents
- 11. Tasks and failures
- More
- Types
- Constants and variables
- Functions
Meilisearch is a fast search engine with typo tolerance, filters, facets and AI powered hybrid search. This package talks to its HTTP API directly with net.http and covers all of it: indexes, documents in JSON, NDJSON or CSV, every search parameter, multi-search and federated search, facet search, similar documents, every index setting, tasks and batches, API keys and tenant tokens, webhooks, dynamic search rules and chat workspaces. This page starts with a tutorial; the full reference of every function and type comes after it.
Tutorial: a movie search in eleven steps
The steps below build one small movie catalogue and search it. Each step is a complete program, and the output under it is what it printed against a real Meilisearch 1.55. Run them in order, because each step uses the data the earlier ones left behind.
First start a server. With Docker that is one command; without it, download the meilisearch binary from the Meilisearch releases page and run it with the same key:
docker run -p 7700:7700 -e MEILI_MASTER_KEY=masterKey getmeili/meilisearch:v1.55.0
The programs assume http://127.0.0.1:7700 and the master key masterKey. A real deployment uses a long random master key and gives applications smaller keys, as step 9 shows.
1. Connect
New makes a client: a plain value with the address and the key, which threads can share. WithTimeout returns a copy that stops waiting after the given milliseconds; without it a request waits as long as the server takes. Every call that can fail takes an Error as its last argument. Ok tells you whether the call worked and ErrorString turns the error into one line.
import db.meilisearch
func main:
c := meilisearch.WithTimeout(meilisearch.New("http://127.0.0.1:7700", "masterKey"), 5000)
if not meilisearch.IsHealthy(c):
println "Meilisearch is not running at " + c.host
ret 1
end
mut err := meilisearch.Error {}
version := meilisearch.GetVersion(c, err)
println "connected to Meilisearch " + version.pkg_version
meilisearch.GetIndex(c, "no_such_index", err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
end
ret 0
endThe error carries everything Meilisearch sent: the HTTP status, the code to branch on (here index_not_found), the message and a link to its documentation. When the server cannot be reached at all, code is communication_error, or timeout when the time limit ran out.
2. Create an index and add documents
An index is a named collection of documents, each with a unique primary key. Documents can be Salam structs: AddDocumentsOf turns each one into JSON. AddDocuments takes JSON text instead, and AddDocumentsNdjson and AddDocumentsCsv take those formats.
import db.meilisearch
struct Movie:
pub id: int = 0
pub title: str = ""
pub genre: str = ""
pub year: int = 0
pub overview: str = ""
end
func movie(id: int, title: str, genre: str, year: int, overview: str): Movie:
ret Movie { id = id, title = title, genre = genre, year = year, overview = overview }
end
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
meilisearch.Wait(c, meilisearch.CreateIndex(c, "movies", "id", err), err)
mut movies := Vector {} as Vector<Movie>
movies.push(movie(1, "Heat", "Crime", 1995, "A detective hunts a crew of professional thieves in Los Angeles."))
movies.push(movie(2, "Moana", "Family", 2016, "A girl sails across the ocean to save her island."))
movies.push(movie(3, "Alien", "Horror", 1979, "The crew of a space freighter meets a deadly creature."))
movies.push(movie(4, "Up", "Family", 2009, "An old man flies his house away with thousands of balloons."))
movies.push(movie(5, "Arrival", "Drama", 2016, "A linguist learns to talk with visitors from another world."))
movies.push(movie(6, "Dune", "Adventure", 2021, "A young noble fights for a desert planet."))
movies.push(movie(7, "Interstellar", "Drama", 2014, "Explorers travel through a wormhole to find a new home."))
movies.push(movie(8, "Coco", "Family", 2017, "A boy enters the land of the dead to find his family."))
task := meilisearch.Wait(c, meilisearch.AddDocumentsOf(c, "movies", movies, "id", err), err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
ret 1
end
println "indexing: " + task.status
stats := meilisearch.GetIndexStats(c, "movies", err)
println "documents in movies: " + stats.number_of_documents
ret 0
endMeilisearch does not apply a change at once. A write returns a TaskInfo, a receipt with a task number, and the server applies the tasks in order in the background. Wait blocks until that task has finished, which is what you want when the next line depends on the change. A batch import does not need to wait after every call; wait once at the end, or not at all.
3. Search
Query searches for some words with every option at its default. The hits come back as JSON text, and HitsAs reads them into your own struct. A struct with fewer fields than the document is fine: the extra fields are ignored.
import db.meilisearch
struct Movie:
pub id: int = 0
pub title: str = ""
pub year: int = 0
end
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
res := meilisearch.Query(c, "movies", "spcae", err)
println "hits for \"" + res.query + "\": " + res.estimated_total_hits
mut movies := Vector {} as Vector<Movie>
if meilisearch.HitsAs(res, movies, err):
each m in movies:
println " " + m.title + " (" + m.year + ")"
end
end
ret 0
endThe query was misspelled on purpose: spcae still finds the movie whose overview says space, because Meilisearch tolerates typos out of the box.
4. Filter, sort and count facets
Filtering and sorting need to be switched on for the fields involved; that is a setting of the index, and UpdateSettings changes several settings in one task. A SearchRequest holds every search option and sends only the ones you set.
import db.meilisearch
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
settings := `{"filterableAttributes": ["genre", "year"], "sortableAttributes": ["year"]}`
meilisearch.Wait(c, meilisearch.UpdateSettings(c, "movies", settings, err), err)
mut req := meilisearch.SearchRequest { filter = "genre = Family AND year > 2010" }
req.sort.push("year:desc")
req.facets.push("genre")
req.attributes_to_retrieve.push("title")
req.attributes_to_retrieve.push("year")
res := meilisearch.Search(c, "movies", req, err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
ret 1
end
each hit in res.hits:
println hit
end
all := meilisearch.Search(c, "movies", meilisearch.SearchRequest { facets = req.facets, limit = 0 }, err)
println "genres: " + all.facet_distribution
ret 0
endfacets asks how many hits have each value of a field, which is how a search page shows filter options with counts. attributes_to_retrieve keeps the hits small by returning only the fields you need.
5. Highlight, crop and page through results
For a results page you usually want the matched words marked and long text cut down around them. Meilisearch adds a _formatted copy of each hit with both done. page and hits_per_page give numbered pages with an exact total; offset and limit are the cheaper choice for endless scrolling.
import db.meilisearch
import encoding.json
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
mut req := meilisearch.SearchRequest { query = "crew", hits_per_page = 1, page = 1 }
req.attributes_to_highlight.push("overview")
req.highlight_pre_tag = "["
req.highlight_post_tag = "]"
req.attributes_to_crop.push("overview")
req.crop_length = 6
res := meilisearch.Search(c, "movies", req, err)
println "page " + res.page + " of " + res.total_pages + ", " + res.total_hits + " hits"
each hit in res.hits:
formatted := json.Get(hit, "_formatted")
println json.Get(hit, "title") + ": " + json.Get(formatted, "overview")
end
ret 0
end6. Tune relevancy
Every index setting has its own Get, Update and Reset function. Synonyms make different words find each other, stop words are ignored in queries, and the searchable attributes choose which fields are searched and how much each one counts.
import db.meilisearch
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
meilisearch.Wait(c, meilisearch.UpdateSynonyms(c, "movies", `{"cartoon": ["family"], "space": ["planet", "wormhole"]}`, err), err)
mut stop := Vector {} as Vector<str>
stop.push("the")
stop.push("a")
meilisearch.Wait(c, meilisearch.UpdateStopWords(c, "movies", stop, err), err)
mut searchable := Vector {} as Vector<str>
searchable.push("title")
searchable.push("overview")
meilisearch.Wait(c, meilisearch.UpdateSearchableAttributes(c, "movies", searchable, err), err)
res := meilisearch.Query(c, "movies", "cartoon", err)
println "hits for \"cartoon\", a synonym of family: " + res.estimated_total_hits
space := meilisearch.Query(c, "movies", "space", err)
println "hits for \"space\": " + space.estimated_total_hits
println "searchable: " + meilisearch.GetSetting(c, "movies", "searchable-attributes", err)
ret 0
endOther settings follow the same pattern: UpdateRankingRules, UpdateTypoTolerance, UpdateDistinctAttribute, UpdatePagination, UpdateFaceting, UpdateDictionary and the rest in the reference below. GetSetting and UpdateSetting reach any setting by its route name, including ones newer than this package.
7. Search several indexes at once
MultiSearch sends several searches in one request and returns one result each. FederatedSearch merges them into a single ranked list, which suits one search box over different kinds of content. FacetSearch searches the values of one facet, for a filter box that completes as you type.
import db.meilisearch
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
meilisearch.Wait(c, meilisearch.AddDocuments(c, "books", `[{"id": 1, "title": "Dune", "author": "Frank Herbert"}, {"id": 2, "title": "Coco and the Moon", "author": "A. Writer"}]`, "id", err), err)
mut queries := Vector {} as Vector<meilisearch.MultiQuery>
queries.push(meilisearch.MultiQuery { index_uid = "movies", request = meilisearch.SearchRequest { query = "dune" } })
queries.push(meilisearch.MultiQuery { index_uid = "books", request = meilisearch.SearchRequest { query = "dune" } })
each r in meilisearch.MultiSearch(c, queries, err):
println r.index_uid + ": " + r.hits.len() + " hit"
end
merged := meilisearch.FederatedSearch(c, queries, meilisearch.Federation { limit = 5 }, err)
println "federated: " + merged.hits.len() + " hits in one list"
genres := meilisearch.FacetSearch(c, "movies", meilisearch.FacetSearchRequest { facet_name = "genre", facet_query = "fam" }, err)
each g in genres.hits:
println "genre " + g.value + ": " + g.count
end
ret 0
end8. Vector and hybrid search
Meilisearch can also search by meaning. An embedder turns documents into vectors; it can call a model such as OpenAI or Hugging Face, or take vectors you computed yourself, which is what the userProvided source in this step does. A search with hybrid_embedder mixes keyword and vector results; a hybrid_semantic_ratio of 1 uses vectors only. SimilarDocuments finds the documents nearest to one you already have.
import db.meilisearch
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
meilisearch.Wait(c, meilisearch.CreateIndex(c, "movies_ai", "id", err), err)
meilisearch.Wait(c, meilisearch.UpdateEmbedders(c, "movies_ai", `{"manual": {"source": "userProvided", "dimensions": 3}}`, err), err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
ret 1
end
docs := `[
{"id": 2, "title": "Moana", "_vectors": {"manual": [0.9, 0.1, 0.0]}},
{"id": 4, "title": "Up", "_vectors": {"manual": [0.8, 0.2, 0.1]}},
{"id": 5, "title": "Arrival", "_vectors": {"manual": [0.1, 0.9, 0.3]}},
{"id": 6, "title": "Dune", "_vectors": {"manual": [0.2, 0.8, 0.4]}},
{"id": 7, "title": "Interstellar", "_vectors": {"manual": [0.1, 0.8, 0.5]}},
{"id": 8, "title": "Coco", "_vectors": {"manual": [0.9, 0.0, 0.1]}}
]`
task := meilisearch.Wait(c, meilisearch.AddDocuments(c, "movies_ai", docs, "", err), err)
println "vectors stored: " + task.status
mut req := meilisearch.SearchRequest { hybrid_embedder = "manual", hybrid_semantic_ratio = 1.0, limit = 2 }
req.vector.push(0.15)
req.vector.push(0.85)
req.vector.push(0.4)
req.attributes_to_retrieve.push("title")
res := meilisearch.Search(c, "movies_ai", req, err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
ret 1
end
each hit in res.hits:
println "close to the query: " + hit
end
mut like := meilisearch.SimilarRequest { id = "2", embedder = "manual", limit = 2 }
like.attributes_to_retrieve.push("title")
each hit in meilisearch.SimilarDocuments(c, "movies_ai", like, err).hits:
println "like Moana: " + hit
end
ret 0
endA userProvided embedder needs a vector in every document, so this step uses its own index. Add the embedder while the index is still empty and send the vectors in each document under _vectors.
9. API keys and tenant tokens
The master key can do everything, so applications should get smaller keys. CreateKey makes a key limited to some actions and indexes. A tenant token goes one step further: TenantToken signs, in your own program and without asking the server, a key that adds a filter to every search. Give each user their own token and they can search directly from the browser while seeing only their rows.
import db.meilisearch
import time
func main:
admin := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
mut r := meilisearch.KeyRequest { name = "Shop front end", description = "Search the movies index only" }
r.actions.push("search")
r.indexes.push("movies")
key := meilisearch.CreateKey(admin, r, err)
println "new key " + key.name + " can: " + key.actions.get(0)
rules := `{"movies": {"filter": "genre = Family"}}`
token := meilisearch.TenantToken(key.uid, key.key, rules, time.Now() + 3600, err)
kids := meilisearch.New("http://127.0.0.1:7700", token)
res := meilisearch.Query(kids, "movies", "", err)
println "the token sees " + res.estimated_total_hits + " family movies"
meilisearch.Query(kids, "books", "", err)
println "books with the token: " + err.code
println "key deleted: " + meilisearch.DeleteKey(admin, key.uid, err)
ret 0
end10. Update and delete documents
AddDocuments replaces a whole document with the same id; UpdateDocuments changes only the fields you send. Documents can be deleted one by one, by a list of ids, by a filter, or all at once.
import db.meilisearch
struct Movie:
pub id: int = 0
pub title: str = ""
pub year: int = 0
end
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
meilisearch.Wait(c, meilisearch.UpdateDocuments(c, "movies", `[{"id": 6, "title": "Dune: Part One"}]`, "", err), err)
mut dune := Movie {}
if meilisearch.GetDocumentAs(c, "movies", "6", dune, err):
println "renamed: " + dune.title + " (" + dune.year + ")"
end
meilisearch.Wait(c, meilisearch.DeleteDocument(c, "movies", "3", err), err)
meilisearch.GetDocument(c, "movies", "3", Vector {} as Vector<str>, err)
println "after delete: " + err.code
removed := meilisearch.Wait(c, meilisearch.DeleteDocumentsByFilter(c, "movies", "year < 2000", err), err)
println "delete by filter: " + removed.status + " " + removed.details
println "left: " + meilisearch.GetIndexStats(c, "movies", err).number_of_documents
ret 0
end11. Tasks and failures
A write that is accepted can still fail later, while the server applies it. The error then lives on the task, not on the call that queued it. WaitForTask copies it into your Error, so the usual check works. GetTasks lists past tasks with filters on index, type, status and dates.
import db.meilisearch
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
info := meilisearch.AddDocuments(c, "movies", `[{"title": "No id here"}]`, "", err)
println "queued task " + info.task_uid + ": " + info.status
task := meilisearch.WaitForTask(c, info.task_uid, 10000, 50, err)
println "finished as " + task.status
if not meilisearch.Ok(err):
println "why: " + err.code
end
mut q := meilisearch.TaskQuery { limit = 3 }
q.index_uids.push("movies")
q.statuses.push(meilisearch.STATUS_SUCCEEDED)
page := meilisearch.GetTasks(c, q, err)
println "recent successful tasks on movies:"
each t in page.results:
println " " + t.kind
end
ret 0
endMore
The rest of the API works the same way; the reference below covers each function. A few pointers:
CreateWebhookregisters a URL that Meilisearch calls when tasks finish, so you do not need to poll.UpdateSearchRulepins or boosts chosen documents for chosen queries, such as a sale banner for sale; it needs thedynamicSearchRulesexperimental feature.UpdateChatSettingsandChatCompletionanswer questions in plain language from your indexes through an LLM; they need thechatCompletionsfeature.WithMetadatatags every document write with a label that comes back on the task, to follow one import through the task list.CreateDump,CreateSnapshot,GetStats,GetMetricsandSetStderrLogsare for running the server.- For a route with no function of its own,
Requestsends any method, path and JSON body.
The Salam repository has one runnable example for each part of the API, in English under tests/en/stdlib/meilisearch/examples and in Persian under tests/fa/stdlib/meilisearch/examples.
Types
SearchRequest
struct SearchRequest| Name | Type | Description |
|---|---|---|
query | str = "" | The words to search for; empty lists every document. |
offset | int = -1 | How many hits to skip. |
limit | int = -1 | How many hits to return; 20 by default. |
page | int = -1 | The page number, for numbered pages with an exact total. |
hits_per_page | int = -1 | The hits on each numbered page. |
filter | str = "" | A filter expression such as year > 2000 AND genre = Drama, or a JSON array of them. |
facets | Vector | Count the values of these fields among the hits. |
attributes_to_retrieve | Vector | Return only these fields. |
attributes_to_crop | Vector | Cut these fields around the matched words. |
crop_length | int = -1 | How many words a cropped field keeps. |
crop_marker | str = "" | The text that marks a cut. |
attributes_to_highlight | Vector | Wrap the matched words of these fields in tags. |
highlight_pre_tag | str = "" | The tag before a match; <em> by default. |
highlight_post_tag | str = "" | The tag after a match. |
show_matches_position | bool = false | Return where every match is. |
sort | Vector | Sort rules such as year:desc. |
matching_strategy | str = "" | One of the MATCH_ values. |
show_ranking_score | bool = false | Return the relevancy score of each hit. |
show_ranking_score_details | bool = false | Return how the score was built. |
ranking_score_threshold | f64 = -1 | Drop hits scoring below this, from 0 to 1. |
attributes_to_search_on | Vector | Search only these fields. |
distinct | str = "" | Return at most one hit for each value of this field. |
locales | Vector | The languages of the query, such as fas. |
vector | Vector | Search by this vector. |
hybrid_embedder | str = "" | The embedder for AI powered search; setting it turns hybrid search on. |
hybrid_semantic_ratio | f64 = -1 | How much meaning outweighs keywords, from 0 to 1. |
retrieve_vectors | bool = false | Also return the stored vectors. |
media | str = "" | Raw JSON media for multimodal search, such as an image. |
show_performance_details | bool = false | Return how long each step of the search took. |
use_network | bool = false | Search every instance of a sharded network. |
personalize | str = "" | Personalization options as raw JSON, such as {"userContext": "..."}. |
inline_rule | str = "" | A dynamic search rule for this search only, as raw JSON. |
extra | str = "" | A raw JSON object whose fields are added to the request, for parameters this struct does not have yet. |
import db.meilisearch
struct Movie:
pub id: int = 0
pub title: str = ""
end
func main:
c := meilisearch.New("http://127.0.0.1:7700", "searchKey")
mut err := meilisearch.Error {}
quick := meilisearch.Query(c, "movies", "botman", err)
println quick.query, quick.estimated_total_hits, quick.processing_time_ms
mut r := meilisearch.SearchRequest { query = "space", limit = 10, offset = 0, filter = "year > 2000 AND genre = Drama" }
r.facets.push("genre")
r.sort.push("year:desc")
r.attributes_to_retrieve.push("id")
r.attributes_to_retrieve.push("title")
r.attributes_to_highlight.push("title")
r.highlight_pre_tag = "<mark>"
r.highlight_post_tag = "</mark>"
r.attributes_to_crop.push("overview")
r.crop_length = 20
r.crop_marker = "..."
r.matching_strategy = meilisearch.MATCH_ALL
r.show_ranking_score = true
r.show_ranking_score_details = false
r.show_matches_position = false
r.ranking_score_threshold = 0.2
r.attributes_to_search_on.push("title")
r.locales.push("eng")
r.distinct = "studio"
res := meilisearch.Search(c, "movies", r, err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
ret
end
println res.index_uid, res.offset, res.limit, res.facet_distribution, res.facet_stats, res.raw.len()
each hit in res.hits:
println hit
end
mut movies := Vector {} as Vector<Movie>
if meilisearch.HitsAs(res, movies, err):
println movies.len()
end
pages := meilisearch.Search(c, "movies", meilisearch.SearchRequest { query = "space", page = 2, hits_per_page = 20 }, err)
println pages.page, pages.hits_per_page, pages.total_hits, pages.total_pages
mut hybrid := meilisearch.SearchRequest { query = "a sad robot", hybrid_embedder = "default", hybrid_semantic_ratio = 0.7, retrieve_vectors = false, matching_strategy = meilisearch.MATCH_LAST }
hybrid.vector.push(0.1)
hybrid.media = `{"image": "https://example.com/robot.png"}`
hybrid.extra = `{"showPerformanceDetails": true}`
println meilisearch.Search(c, "movies", hybrid, err).semantic_hit_count, meilisearch.MATCH_FREQUENCY
mut queries := Vector {} as Vector<meilisearch.MultiQuery>
queries.push(meilisearch.MultiQuery { index_uid = "movies", request = meilisearch.SearchRequest { query = "moana" } })
queries.push(meilisearch.MultiQuery { index_uid = "books", request = meilisearch.SearchRequest { query = "moana" }, weight = 0.5, remote = "" })
each one in meilisearch.MultiSearch(c, queries, err):
println one.index_uid, one.hits.len()
end
fed := meilisearch.FederatedSearch(c, queries, meilisearch.Federation { offset = 0, limit = 20, page = -1, hits_per_page = -1, facets_by_index = `{"movies": ["genre"]}`, merge_facets = `{}` }, err)
println fed.hits.len()
mut fr := meilisearch.FacetSearchRequest { facet_name = "genre", facet_query = "dra", query = "space", filter = "year > 2000", matching_strategy = meilisearch.MATCH_ALL, exhaustive_facet_count = true }
fr.attributes_to_search_on.push("title")
fs := meilisearch.FacetSearch(c, "movies", fr, err)
println fs.facet_query, fs.processing_time_ms
each h in fs.hits:
println h.value, h.count
end
mut sr := meilisearch.SimilarRequest { id = "143", embedder = "default", limit = 5, offset = 0, filter = "year > 2000", show_ranking_score = true, show_ranking_score_details = false, ranking_score_threshold = 0.5, retrieve_vectors = false }
sr.attributes_to_retrieve.push("title")
println meilisearch.SimilarDocuments(c, "movies", sr, err).hits.len()
mut more := meilisearch.SearchRequest { query = "space", show_performance_details = true, use_network = false, personalize = `{"userContext": "likes old films"}`, inline_rule = `{"actions": {"pin": [{"id": "1", "position": 0}]}}` }
more.locales.push("eng")
detailed := meilisearch.Search(c, "movies", more, err)
println detailed.request_uid, detailed.performance_details, detailed.query_vector, detailed.remote_errors, detailed.metadata, detailed.facets_by_index
mut fq := meilisearch.FacetSearchRequest { facet_name = "genre", ranking_score_threshold = 0.1, hybrid_embedder = "default", hybrid_semantic_ratio = 0.5, media = "", use_network = false }
fq.locales.push("eng")
fq.vector.push(0.2)
println meilisearch.FacetSearch(c, "movies", fq, err).remote_errors
mut posq := Vector {} as Vector<meilisearch.MultiQuery>
posq.push(meilisearch.MultiQuery { index_uid = "movies", request = meilisearch.SearchRequest { query = "up" }, query_position = 0 })
println meilisearch.FederatedSearch(c, posq, meilisearch.Federation { distinct = "studio", personalize = "", show_performance_details = true }, err).hits.len()
println meilisearch.SimilarDocuments(c, "movies", meilisearch.SimilarRequest { id = "1", embedder = "default", show_performance_details = true }, err).hits.len()
endSearchResult
struct SearchResult| Name | Type | Description |
|---|---|---|
index_uid | str = "" | The index, in multi-search results. |
hits | Vector | Each hit as its own JSON text; read them into structs with HitsAs. |
query | str = "" | The query that was run. |
processing_time_ms | i64 = 0 | How long the search took, in milliseconds. |
offset | i64 = -1 | How many hits were skipped. |
limit | i64 = -1 | The page size. |
estimated_total_hits | i64 = -1 | About how many documents match. |
page | i64 = -1 | The page number, with numbered pages. |
hits_per_page | i64 = -1 | The hits on each page. |
total_hits | i64 = -1 | Exactly how many documents match, with numbered pages. |
total_pages | i64 = -1 | How many pages there are. |
facet_distribution | str = "" | The value counts of the requested facets, as raw JSON. |
facet_stats | str = "" | The minimum and maximum of numeric facets, as raw JSON. |
semantic_hit_count | i64 = -1 | How many hits came from meaning rather than keywords. |
performance_details | str = "" | How long each step took, as raw JSON. |
query_vector | str = "" | The vector the query was turned into, as raw JSON. |
remote_errors | str = "" | Errors from other instances of a sharded network, as raw JSON. |
request_uid | str = "" | The id of this search request. |
metadata | str = "" | Extra information about the query, as raw JSON. |
facets_by_index | str = "" | The facets of each index, in a federated search. |
raw | str = "" | The whole response body. |
The example for this item is shown with the ones above: db-meilisearch-Search.salam
MultiQuery
struct MultiQuery| Name | Type | Description |
|---|---|---|
index_uid | str = "" | The index to search. |
request | SearchRequest | The search itself. |
weight | f64 = -1 | In a federated search, how much this query counts; -1 leaves it out. |
remote | str = "" | In a federated search across instances, the remote to ask. |
query_position | int = -1 | In a federated search, the position used to break ties; -1 leaves it out. |
The example for this item is shown with the ones above: db-meilisearch-Search.salam
Federation
struct Federation| Name | Type | Description |
|---|---|---|
offset | int = -1 | How many merged hits to skip. |
limit | int = -1 | How many merged hits to return. |
page | int = -1 | The page number. |
hits_per_page | int = -1 | The hits on each page. |
facets_by_index | str = "" | Facets to count for each index, as raw JSON. |
merge_facets | str = "" | How to merge those facets, as raw JSON. |
distinct | str = "" | Return at most one merged hit for each value of this field. |
personalize | str = "" | Personalization options for the merged list, as raw JSON. |
show_performance_details | bool = false | Return how long each step took. |
The example for this item is shown with the ones above: db-meilisearch-Search.salam
FacetSearchRequest
struct FacetSearchRequest| Name | Type | Description |
|---|---|---|
facet_name | str = "" | The facet field. |
facet_query | str = "" | The text the values should start with. |
query | str = "" | Count only documents matching this search. |
filter | str = "" | Count only documents matching this filter. |
matching_strategy | str = "" | One of the MATCH_ values. |
attributes_to_search_on | Vector | Search only these fields. |
exhaustive_facet_count | bool = false | Count exactly, which is slower. |
ranking_score_threshold | f64 = -1 | Count only documents scoring at least this. |
locales | Vector | The languages of the query. |
vector | Vector | Search by this vector. |
hybrid_embedder | str = "" | The embedder for hybrid search. |
hybrid_semantic_ratio | f64 = -1 | How much meaning outweighs keywords. |
media | str = "" | Raw JSON media for multimodal search. |
use_network | bool = false | Ask every instance of a sharded network. |
The example for this item is shown with the ones above: db-meilisearch-Search.salam
FacetHit
struct FacetHit| Name | Type | Description |
|---|---|---|
value | str = "" | The value. |
count | i64 = 0 | How many documents have it. |
The example for this item is shown with the ones above: db-meilisearch-Search.salam
FacetSearchResult
struct FacetSearchResult| Name | Type | Description |
|---|---|---|
hits | Vector | The matching values. |
facet_query | str = "" | The facet query that was run. |
processing_time_ms | i64 = 0 | How long it took, in milliseconds. |
remote_errors | str = "" | Errors from other instances, as raw JSON. |
The example for this item is shown with the ones above: db-meilisearch-Search.salam
SimilarRequest
struct SimilarRequest| Name | Type | Description |
|---|---|---|
id | str = "" | The document to compare with. |
embedder | str = "" | The embedder whose vectors are compared. |
offset | int = -1 | How many hits to skip. |
limit | int = -1 | How many hits to return. |
filter | str = "" | Only documents matching this filter. |
attributes_to_retrieve | Vector | Return only these fields. |
show_ranking_score | bool = false | Return the similarity score. |
show_ranking_score_details | bool = false | Return how the score was built. |
ranking_score_threshold | f64 = -1 | Drop hits scoring below this. |
retrieve_vectors | bool = false | Also return the stored vectors. |
show_performance_details | bool = false | Return how long each step took. |
The example for this item is shown with the ones above: db-meilisearch-Search.salam
Webhook
struct Webhook| Name | Type | Description |
|---|---|---|
uuid | str = "" | Its id. |
url | str = "" | The URL called. |
headers | str = "" | The headers sent with each call, as raw JSON; secret values come back hidden. |
is_editable | bool = false | It can be changed; webhooks set from the command line cannot. |
import db.meilisearch
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
hook := meilisearch.CreateWebhook(c, "https://example.com/meilisearch-hook", `{"Authorization": "Bearer hook-secret"}`, err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
ret
end
println hook.uuid, hook.url, hook.headers, hook.is_editable
println meilisearch.GetWebhook(c, hook.uuid, err).url
println meilisearch.UpdateWebhook(c, hook.uuid, "https://example.com/v2/hook", "", err).url
each w in meilisearch.ListWebhooks(c, err):
println w.uuid, w.url
end
println meilisearch.DeleteWebhook(c, hook.uuid, err)
endTaskInfo
struct TaskInfoWait.| Name | Type | Description |
|---|---|---|
task_uid | i64 = -1 | The task number; -1 when the call failed. |
index_uid | str = "" | The index it changes, if any. |
status | str = "" | The status when it was queued. |
kind | str = "" | The task type, such as documentAdditionOrUpdate. |
enqueued_at | str = "" | When it was queued. |
custom_metadata | str = "" | The metadata the write was tagged with. |
import db.meilisearch
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
info := meilisearch.DeleteIndex(c, "old_movies", err)
t := meilisearch.WaitForTask(c, info.task_uid, 30000, 100, err)
println t.uid, t.batch_uid, t.index_uid, t.status, t.kind, t.canceled_by, t.details, t.duration
println t.enqueued_at, t.started_at, t.finished_at
if t.status == meilisearch.STATUS_FAILED:
println t.error.code, t.error.message
end
println meilisearch.GetTask(c, info.task_uid, err).status
mut q := meilisearch.TaskQuery { limit = 20, from = -1, reverse = true, after_enqueued_at = "2025-01-01T00:00:00Z" }
q.statuses.push(meilisearch.STATUS_SUCCEEDED)
q.statuses.push(meilisearch.STATUS_FAILED)
q.index_uids.push("movies")
q.types.push("documentAdditionOrUpdate")
q.uids.push(1)
q.batch_uids.push(1)
q.canceled_by.push(2)
q.before_enqueued_at = "2030-01-01T00:00:00Z"
q.before_started_at = "2030-01-01T00:00:00Z"
q.after_started_at = "2025-01-01T00:00:00Z"
q.before_finished_at = "2030-01-01T00:00:00Z"
q.after_finished_at = "2025-01-01T00:00:00Z"
page := meilisearch.GetTasks(c, q, err)
println page.total, page.limit, page.from, page.next
each task in page.results:
println task.uid, task.kind, task.status
end
mut pending := meilisearch.TaskQuery {}
pending.statuses.push(meilisearch.STATUS_ENQUEUED)
pending.statuses.push(meilisearch.STATUS_PROCESSING)
println meilisearch.CancelTasks(c, pending, err).task_uid
mut finished := meilisearch.TaskQuery {}
finished.statuses.push(meilisearch.STATUS_CANCELED)
println meilisearch.DeleteTasks(c, finished, err).task_uid
batches := meilisearch.GetBatches(c, meilisearch.TaskQuery { limit = 5 }, err)
println batches.total, batches.limit, batches.from, batches.next
each b in batches.results:
one := meilisearch.GetBatch(c, b.uid, err)
println one.uid, one.batch_strategy, one.details, one.stats, one.progress, one.duration, one.started_at, one.finished_at
end
println t.custom_metadata, t.network, info.custom_metadata
println meilisearch.GetTaskDocuments(c, info.task_uid, err)
comp := meilisearch.CompactTasks(c, err)
println comp.status, comp.pre_size, comp.post_size, comp.action_required, comp.error_message
endTask
struct Task| Name | Type | Description |
|---|---|---|
uid | i64 = -1 | The task number. |
batch_uid | i64 = -1 | The batch it ran in; -1 before it runs. |
index_uid | str = "" | The index it changes. |
status | str = "" | One of the STATUS_ values. |
kind | str = "" | The task type. |
canceled_by | i64 = -1 | The task that canceled it; -1 if none. |
details | str = "" | Details that depend on the type, as raw JSON. |
error | Error | Why it failed. |
duration | str = "" | How long it ran, as an ISO 8601 duration. |
enqueued_at | str = "" | When it was queued. |
started_at | str = "" | When it started. |
finished_at | str = "" | When it finished. |
custom_metadata | str = "" | The metadata the write was tagged with. |
network | str = "" | Where the task came from in a sharded network, as raw JSON. |
The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
TaskQuery
struct TaskQuery| Name | Type | Description |
|---|---|---|
uids | Vector | Only these tasks. |
batch_uids | Vector | Only tasks of these batches. |
canceled_by | Vector | Only tasks canceled by these tasks. |
statuses | Vector | Only these statuses. |
types | Vector | Only these task types. |
index_uids | Vector | Only tasks of these indexes. |
limit | int = 0 | The page size; 0 for the default. Listing only. |
from | i64 = -1 | Start from this task number; -1 for the newest. Listing only. |
reverse | bool = false | Oldest first. Listing only. |
before_enqueued_at | str = "" | Queued before this date. |
after_enqueued_at | str = "" | Queued after this date. |
before_started_at | str = "" | Started before this date. |
after_started_at | str = "" | Started after this date. |
before_finished_at | str = "" | Finished before this date. |
after_finished_at | str = "" | Finished after this date. |
The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
TaskCompaction
struct TaskCompaction| Name | Type | Description |
|---|---|---|
status | str = "" | The outcome. |
pre_size | str = "" | The size before. |
post_size | str = "" | The size after. |
action_required | str = "" | What you must do next; Meilisearch asks for a restart. |
error_message | str = "" | Why it failed, if it did. |
The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
TaskPage
struct TaskPage| Name | Type | Description |
|---|---|---|
results | Vector | The tasks, newest first. |
limit | i64 = 0 | The page size. |
from | i64 = -1 | The first task number on this page. |
next | i64 = -1 | Pass this as from for the next page; -1 on the last page. |
total | i64 = 0 | How many tasks match. |
The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
Batch
struct Batch| Name | Type | Description |
|---|---|---|
uid | i64 = -1 | The batch number. |
details | str = "" | Details of its tasks, as raw JSON. |
stats | str = "" | Counts by status, type and index, as raw JSON. |
progress | str = "" | Progress while it runs, as raw JSON; empty when done. |
batch_strategy | str = "" | Why the tasks were grouped this way. |
duration | str = "" | How long it ran. |
started_at | str = "" | When it started. |
finished_at | str = "" | When it finished. |
The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
BatchPage
struct BatchPage| Name | Type | Description |
|---|---|---|
results | Vector | The batches. |
limit | i64 = 0 | The page size. |
from | i64 = -1 | The first batch number on this page. |
next | i64 = -1 | Pass this as from for the next page; -1 on the last page. |
total | i64 = 0 | How many batches match. |
The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
Index
struct Index| Name | Type | Description |
|---|---|---|
uid | str = "" | The index name. |
primary_key | str = "" | The field that identifies a document; empty until it is known. |
created_at | str = "" | When the index was made. |
updated_at | str = "" | When it last changed. |
import db.meilisearch
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
info := meilisearch.CreateIndex(c, "movies", "id", err)
println info.task_uid, info.index_uid, info.status, info.kind, info.enqueued_at
done := meilisearch.Wait(c, info, err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
ret
end
println done.status
i := meilisearch.GetIndex(c, "movies", err)
println i.uid, i.primary_key, i.created_at, i.updated_at
page := meilisearch.ListIndexes(c, 0, 20, err)
println page.total, page.offset, page.limit
each idx in page.results:
println idx.uid
end
meilisearch.WaitForTask(c, meilisearch.UpdateIndex(c, "movies", "movie_id", err).task_uid, 10000, 50, err)
meilisearch.Wait(c, meilisearch.RenameIndex(c, "movies", "films", err), err)
mut swaps := Vector {} as Vector<meilisearch.IndexSwap>
swaps.push(meilisearch.IndexSwap { first = "films", second = "films_next" })
swaps.push(meilisearch.IndexSwap { first = "drafts", second = "drafts_v2", rename = true })
meilisearch.Wait(c, meilisearch.SwapIndexes(c, swaps, err), err)
s := meilisearch.GetIndexStats(c, "films", err)
println s.number_of_documents, s.raw_document_db_size, s.avg_document_size, s.is_indexing
println s.number_of_embeddings, s.number_of_embedded_documents, s.field_distribution
meilisearch.Wait(c, meilisearch.CompactIndex(c, "movies", err), err)
mut fq := meilisearch.FieldsQuery { offset = 0, limit = 50, filter = `{"filterable": true}` }
fq.attribute_patterns.push("*")
fields := meilisearch.ListFields(c, "movies", fq, err)
println fields.total, fields.offset, fields.limit
each f in fields.results:
println f.name, f.displayed, f.searchable, f.sortable, f.distinct, f.filterable, f.ranking_rule, f.localized, f.raw.len()
end
println s.index_size, s.used_index_size, s.internal_database_sizes
meilisearch.Wait(c, meilisearch.DeleteIndex(c, "films", err), err)
endIndexPage
struct IndexPage| Name | Type | Description |
|---|---|---|
results | Vector | The indexes on this page. |
offset | i64 = 0 | How many were skipped. |
limit | i64 = 0 | The page size. |
total | i64 = 0 | How many indexes there are. |
The example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
IndexStats
struct IndexStats| Name | Type | Description |
|---|---|---|
number_of_documents | i64 = 0 | How many documents it holds. |
raw_document_db_size | i64 = 0 | The size of the stored documents, in bytes. |
avg_document_size | i64 = 0 | The average document size, in bytes. |
is_indexing | bool = false | A task is changing it right now. |
number_of_embeddings | i64 = 0 | How many vectors it holds. |
number_of_embedded_documents | i64 = 0 | How many documents have at least one vector. |
field_distribution | str = "" | How many documents have each field, as raw JSON. |
index_size | i64 = 0 | The size of the index on disk, in bytes. |
used_index_size | i64 = 0 | The bytes of the index actually in use. |
internal_database_sizes | str = "" | The size of each internal database, as raw JSON. |
The example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
IndexSwap
struct IndexSwapSwapIndexes.| Name | Type | Description |
|---|---|---|
first | str = "" | The first index. |
second | str = "" | The second index. |
rename | bool = false | Rename first to second instead of swapping, when second does not exist. |
The example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
Field
struct Field| Name | Type | Description |
|---|---|---|
name | str = "" | The field name. |
displayed | bool = false | It is returned in hits. |
searchable | bool = false | It is searched. |
sortable | bool = false | You can sort by it. |
distinct | bool = false | It is the distinct attribute. |
filterable | bool = false | You can filter on it. |
ranking_rule | str = "" | Its ranking rule settings, as raw JSON. |
localized | str = "" | Its languages, as raw JSON. |
raw | str = "" | The whole field entry. |
The example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
FieldsQuery
struct FieldsQueryListFields returns.| Name | Type | Description |
|---|---|---|
offset | int = -1 | How many to skip; -1 leaves it out. |
limit | int = -1 | How many to return; -1 leaves it out. |
attribute_patterns | Vector | Only fields matching these patterns, such as title or *_date. |
filter | str = "" | More conditions as a JSON object, such as {"filterable": true}. |
The example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
FieldPage
struct FieldPage| Name | Type | Description |
|---|---|---|
results | Vector | The fields. |
offset | i64 = 0 | How many were skipped. |
limit | i64 = 0 | The page size. |
total | i64 = 0 | How many fields match. |
The example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
Client
struct ClientNew and share it freely.| Name | Type | Description |
|---|---|---|
host | str = "" | The server address, such as http://127.0.0.1:7700, with no trailing slash. |
api_key | str = "" | The API key sent as Authorization: Bearer; empty sends no header. |
agent | str = "" | Extra text added to the client header, such as your app name. |
timeout_ms | int = 0 | Give up on a request after this many milliseconds with the code timeout; 0 waits as long as it takes. |
metadata | str = "" | Text attached as customMetadata to every document write; it comes back on the task. |
import db.meilisearch
func main:
c := meilisearch.WithAgent(meilisearch.New("http://127.0.0.1:7700", "masterKey"), "my-app/1.0")
mut err := meilisearch.Error {}
if not meilisearch.IsHealthy(c):
println "Meilisearch is not reachable at " + c.host
ret
end
println meilisearch.Health(c, err), meilisearch.VERSION
v := meilisearch.GetVersion(c, err)
println v.pkg_version, v.commit_sha, v.commit_date
st := meilisearch.GetStats(c, err)
println st.database_size, st.used_database_size, st.last_update, st.indexes
dump := meilisearch.CreateDump(c, err)
println dump.task_uid, meilisearch.CreateSnapshot(c, err).status
println meilisearch.GetExperimentalFeatures(c, err)
println meilisearch.UpdateExperimentalFeatures(c, `{"metrics": true}`, err)
println meilisearch.GetMetrics(c, err).len()
println meilisearch.GetNetwork(c, err)
println meilisearch.UpdateNetwork(c, `{"self": "ms-0"}`, err)
println meilisearch.Export(c, `{"url": "http://backup:7700", "apiKey": "key"}`, err).kind
body := meilisearch.Request(c, "GET", "/indexes?limit=1", "", err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
println err.status, err.code, err.kind, err.message, err.link
ret
end
println body
println meilisearch.RequestAs(c, "POST", "/indexes/movies/documents", "application/x-ndjson", "{\"id\": 1}\n", err)
p := meilisearch.Page {}
println p.results.len(), p.offset, p.limit, p.total, p.from, p.next, c.api_key.len() > 0, c.agent
quick := meilisearch.WithTimeout(c, 2000)
println quick.timeout_ms, meilisearch.IsHealthy(quick)
tagged := meilisearch.WithMetadata(c, "nightly-import")
println tagged.metadata
println meilisearch.SetStderrLogs(c, "info", err)
println meilisearch.RenderTemplate(c, `{"template": {"kind": "inlineDocumentTemplate", "inline": "{{doc.title}}"}, "input": {"kind": "inlineDocument", "inline": {"title": "Up"}}}`, err)
println meilisearch.NetworkControl(c, `{"origin": {"remoteName": "ms-0", "taskUid": 1}, "message": {"type": "exportNoIndexForRemote", "remote": "ms-1"}}`, err)
endError
struct Errorcode means the call worked; every function clears it before it starts.| Name | Type | Description |
|---|---|---|
status | int = 0 | The HTTP status; 0 when the server could not be reached or the error happened in the client. |
code | str = "" | The Meilisearch error code, such as index_not_found, or communication_error, timeout and decode_error from the client. |
kind | str = "" | The error type: invalid_request, auth, internal and so on. |
message | str = "" | The human readable message. |
link | str = "" | A link to the page of the Meilisearch documentation about this error. |
The example for this item is shown with the ones above: db-meilisearch-Client.salam
Page
struct PageGetDocuments.| Name | Type | Description |
|---|---|---|
results | Vector | Each document as its own JSON text. |
offset | i64 = 0 | How many documents were skipped. |
limit | i64 = 0 | The page size. |
total | i64 = 0 | How many documents match in total. |
from | i64 = -1 | Unused for documents; -1. |
next | i64 = -1 | Unused for documents; -1. |
The example for this item is shown with the ones above: db-meilisearch-Client.salam
Key
struct Key| Name | Type | Description |
|---|---|---|
uid | str = "" | The key id, a UUID. |
key | str = "" | The secret key value to send. |
name | str = "" | Its name. |
description | str = "" | Its description. |
actions | Vector | What it may do, such as search or * for everything. |
indexes | Vector | Which indexes it may use; * for all. |
expires_at | str = "" | When it stops working; empty for never. |
created_at | str = "" | When it was made. |
updated_at | str = "" | When it last changed. |
import db.meilisearch
import time
func main:
admin := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
mut r := meilisearch.KeyRequest { name = "Front end search", description = "Used by the web app", expires_at = "2030-01-01T00:00:00Z", uid = "" }
r.actions.push("search")
r.indexes.push("movies")
k := meilisearch.CreateKey(admin, r, err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
ret
end
println k.uid, k.key, k.name, k.description, k.expires_at, k.created_at, k.updated_at
println k.actions.len(), k.indexes.len()
println meilisearch.GetKey(admin, k.uid, err).name
page := meilisearch.GetKeys(admin, 0, 20, err)
println page.total, page.offset, page.limit
each one in page.results:
println one.name
end
println meilisearch.UpdateKey(admin, k.uid, "Web search", "Search only, movies only", err).name
rules := `{"movies": {"filter": "user_id = 42"}}`
token := meilisearch.TenantToken(k.uid, k.key, rules, time.Now() + 3600, err)
user := meilisearch.New("http://127.0.0.1:7700", token)
println meilisearch.Query(user, "movies", "", err).hits.len()
println meilisearch.DeleteKey(admin, k.uid, err)
endKeyRequest
struct KeyRequest| Name | Type | Description |
|---|---|---|
uid | str = "" | A UUID to use as its id; empty lets the server pick one. |
name | str = "" | Its name. |
description | str = "" | Its description. |
actions | Vector | What it may do. |
indexes | Vector | Which indexes it may use. |
expires_at | str = "" | An RFC 3339 date when it stops working; empty for never. |
The example for this item is shown with the ones above: db-meilisearch-CreateKey.salam
KeyPage
struct KeyPage| Name | Type | Description |
|---|---|---|
results | Vector | The keys. |
offset | i64 = 0 | How many were skipped. |
limit | i64 = 0 | The page size. |
total | i64 = 0 | How many keys there are. |
The example for this item is shown with the ones above: db-meilisearch-CreateKey.salam
SearchRule
struct SearchRule| Name | Type | Description |
|---|---|---|
uid | str = "" | The rule name. |
last_updated_at | str = "" | When it last changed. |
precedence | i64 = -1 | Which rule wins when several match; -1 when unset. |
active | bool = false | It is on. |
conditions | str = "" | When it applies, as raw JSON: a time range, query words or filter values. |
actions | str = "" | What it does, as raw JSON: pin and scale. |
raw | str = "" | The whole rule. |
import db.meilisearch
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
meilisearch.UpdateExperimentalFeatures(c, `{"dynamicSearchRules": true}`, err)
rule := `{"active": true, "precedence": 1, "conditions": {"query": {"words": "sale"}}, "actions": {"pin": [{"id": "42", "position": 0}]}}`
meilisearch.Wait(c, meilisearch.UpdateSearchRule(c, "black-friday", rule, err), err)
r := meilisearch.GetSearchRule(c, "black-friday", err)
println r.uid, r.active, r.precedence, r.last_updated_at, r.conditions, r.actions, r.raw.len()
page := meilisearch.ListSearchRules(c, meilisearch.SearchRuleQuery { offset = 0, limit = 20, query = "sale", active = 1 }, err)
println page.total, page.offset, page.limit
each one in page.results:
println one.uid
end
meilisearch.Wait(c, meilisearch.DeleteSearchRule(c, "black-friday", err), err)
meilisearch.Wait(c, meilisearch.DeleteAllSearchRules(c, err), err)
endSearchRuleQuery
struct SearchRuleQueryListSearchRules returns.| Name | Type | Description |
|---|---|---|
offset | int = -1 | How many to skip; -1 leaves it out. |
limit | int = -1 | How many to return; -1 leaves it out. |
query | str = "" | Only rules matching this text. |
active | int = -1 | 1 for active rules only, 0 for inactive ones, -1 for both. |
The example for this item is shown with the ones above: db-meilisearch-UpdateSearchRule.salam
SearchRulePage
struct SearchRulePage| Name | Type | Description |
|---|---|---|
results | Vector | The rules. |
offset | i64 = 0 | How many were skipped. |
limit | i64 = 0 | The page size. |
total | i64 = 0 | How many rules match. |
The example for this item is shown with the ones above: db-meilisearch-UpdateSearchRule.salam
Version
struct Version| Name | Type | Description |
|---|---|---|
pkg_version | str = "" | The version, such as 1.15.2. |
commit_sha | str = "" | The commit the server was built from. |
commit_date | str = "" | The date of that commit. |
The example for this item is shown with the ones above: db-meilisearch-Client.salam
Stats
struct Stats| Name | Type | Description |
|---|---|---|
database_size | i64 = 0 | The database size on disk, in bytes. |
used_database_size | i64 = 0 | The bytes actually in use. |
last_update | str = "" | When anything last changed. |
indexes | str = "" | The statistics of every index, as raw JSON. |
The example for this item is shown with the ones above: db-meilisearch-Client.salam
ChatWorkspacePage
struct ChatWorkspacePage| Name | Type | Description |
|---|---|---|
results | Vector | The workspace names. |
offset | i64 = 0 | How many were skipped. |
limit | i64 = 0 | The page size. |
total | i64 = 0 | How many workspaces there are. |
import db.meilisearch
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
meilisearch.UpdateExperimentalFeatures(c, `{"chatCompletions": true}`, err)
settings := `{"source": "openAi", "apiKey": "sk-your-key", "prompts": {"system": "You answer questions about our movie catalog."}}`
println meilisearch.UpdateChatSettings(c, "support", settings, err)
println meilisearch.GetChatSettings(c, "support", err)
ws := meilisearch.ListChatWorkspaces(c, 0, 20, err)
println ws.total, ws.offset, ws.limit
each name in ws.results:
println name, meilisearch.GetChatWorkspace(c, name, err)
end
request := `{"model": "gpt-4o-mini", "stream": true, "messages": [{"role": "user", "content": "Which space movies do you have?"}]}`
println meilisearch.ChatCompletion(c, "support", request, err)
if not meilisearch.Ok(err):
println meilisearch.ErrorString(err)
end
println meilisearch.ResetChatSettings(c, "support", err)
println meilisearch.DeleteChatWorkspace(c, "support", err)
endDocumentsQuery
struct DocumentsQueryGetDocuments returns. Zero values and empty lists are left out.| Name | Type | Description |
|---|---|---|
offset | int = 0 | How many to skip. |
limit | int = 0 | How many to return. |
fields | Vector | Return only these fields. |
filter | str = "" | A filter expression, or a JSON array of them; the fields must be filterable. |
ids | Vector | Return only these documents. |
sort | Vector | Sort rules such as year:desc; the fields must be sortable. |
retrieve_vectors | bool = false | Also return the stored vectors. |
use_network | bool = false | Ask every instance of a sharded network. |
import db.meilisearch
struct Movie:
pub id: int = 0
pub title: str = ""
pub year: int = 0
end
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
docs := `[{"id": 1, "title": "Carol", "year": 2015}, {"id": 2, "title": "Moana", "year": 2016}]`
meilisearch.Wait(c, meilisearch.AddDocuments(c, "movies", docs, "id", err), err)
meilisearch.Wait(c, meilisearch.UpdateDocuments(c, "movies", `[{"id": 2, "year": 2017}]`, "", err), err)
meilisearch.Wait(c, meilisearch.AddDocumentsNdjson(c, "movies", "{\"id\": 3, \"title\": \"Heat\"}\n", "", err), err)
meilisearch.Wait(c, meilisearch.UpdateDocumentsNdjson(c, "movies", "{\"id\": 3, \"year\": 1995}\n", "", err), err)
meilisearch.Wait(c, meilisearch.AddDocumentsCsv(c, "movies", "id:number;title\n4;Up\n", "", ";", err), err)
meilisearch.Wait(c, meilisearch.UpdateDocumentsCsv(c, "movies", "id:number,year:number\n4,2009\n", "", "", err), err)
mut typed := Vector {} as Vector<Movie>
typed.push(Movie { id = 5, title = "Alien", year = 1979 })
meilisearch.Wait(c, meilisearch.AddDocumentsOf(c, "movies", typed, "id", err), err)
mut many := Vector {} as Vector<str>
repeat 2500 in i:
many.push(`{"id": ` + (100 + i) + `, "title": "Movie ` + i + `"}`)
end
tasks := meilisearch.AddDocumentsInBatches(c, "movies", many, 1000, "id", err)
each t in tasks:
meilisearch.Wait(c, t, err)
end
mut fields := Vector {} as Vector<str>
fields.push("title")
println meilisearch.GetDocument(c, "movies", "1", fields, err)
mut m := Movie {}
if meilisearch.GetDocumentAs(c, "movies", "2", m, err):
println m.title, m.year
end
mut q := meilisearch.DocumentsQuery { limit = 10, filter = "year > 2000", retrieve_vectors = false }
q.fields.push("id")
q.fields.push("title")
q.sort.push("year:desc")
q.ids.push("1")
q.ids.push("2")
page := meilisearch.GetDocuments(c, "movies", meilisearch.DocumentsQuery { offset = 0, limit = 20 }, err)
mut movies := Vector {} as Vector<Movie>
if meilisearch.DocumentsAs(page, movies, err):
println movies.len(), page.total
end
println meilisearch.GetDocuments(c, "movies", q, err).results.len()
meilisearch.Wait(c, meilisearch.UpdateDocumentsByFunction(c, "movies", "doc.title = doc.title.to_upper()", "id < 10", "", err), err)
meilisearch.Wait(c, meilisearch.DeleteDocument(c, "movies", "5", err), err)
mut ids := Vector {} as Vector<str>
ids.push("3")
ids.push("4")
meilisearch.Wait(c, meilisearch.DeleteDocuments(c, "movies", ids, err), err)
meilisearch.Wait(c, meilisearch.DeleteDocumentsByFilter(c, "movies", "id >= 100", err), err)
meilisearch.Wait(c, meilisearch.DeleteAllDocuments(c, "movies", err), err)
println meilisearch.ErrorString(err)
tagged := meilisearch.WithMetadata(c, "import-2026-10-16")
opts := meilisearch.DocumentOptions { content_type = "application/x-ndjson", update = true, primary_key = "id", csv_delimiter = "", skip_creation = true }
meilisearch.Wait(c, meilisearch.AddDocumentsWith(tagged, "movies", "{\"id\": 1, \"year\": 2016}\n", opts, err), err)
println meilisearch.GetDocumentWith(c, "movies", "1", meilisearch.DocumentsQuery { retrieve_vectors = true, use_network = false }, err)
endDocumentOptions
struct DocumentOptionsAddDocumentsWith sends documents.| Name | Type | Description |
|---|---|---|
content_type | str = "" | application/json (the default), application/x-ndjson or text/csv. |
update | bool = false | Merge into existing documents instead of replacing them. |
primary_key | str = "" | The primary key, when the index does not have one yet. |
csv_delimiter | str = "" | The CSV delimiter; empty means a comma. |
skip_creation | bool = false | Only change documents that already exist; new ids are ignored. |
The example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
Constants and variables
MATCH_LAST
const MATCH_LAST: str = "last"The example for this item is shown with the ones above: db-meilisearch-Search.salam
MATCH_ALL
const MATCH_ALL: str = "all"The example for this item is shown with the ones above: db-meilisearch-Search.salam
MATCH_FREQUENCY
const MATCH_FREQUENCY: str = "frequency"The example for this item is shown with the ones above: db-meilisearch-Search.salam
STATUS_ENQUEUED
const STATUS_ENQUEUED: str = "enqueued"The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
STATUS_PROCESSING
const STATUS_PROCESSING: str = "processing"The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
STATUS_SUCCEEDED
const STATUS_SUCCEEDED: str = "succeeded"The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
STATUS_FAILED
const STATUS_FAILED: str = "failed"The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
STATUS_CANCELED
const STATUS_CANCELED: str = "canceled"The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
VERSION
const VERSION: str = "1.0.0"X-Meilisearch-Client header.The example for this item is shown with the ones above: db-meilisearch-Client.salam
Functions
Search
func Search(c: Client, uid: str, r: SearchRequest, err &: Error): SearchResultThe example for this item is shown with the ones above: db-meilisearch-Search.salam
Query
func Query(c: Client, uid: str, q: str, err &: Error): SearchResultThe example for this item is shown with the ones above: db-meilisearch-Search.salam
HitsAs
func HitsAs<T>(r: SearchResult, out &: Vector<T>, err &: Error): bool_formatted that the struct does not have are ignored.The example for this item is shown with the ones above: db-meilisearch-Search.salam
MultiSearch
func MultiSearch(c: Client, queries: Vector<MultiQuery>, err &: Error): Vector<SearchResult>The example for this item is shown with the ones above: db-meilisearch-Search.salam
FederatedSearch
func FederatedSearch(c: Client, queries: Vector<MultiQuery>, f: Federation, err &: Error): SearchResultThe example for this item is shown with the ones above: db-meilisearch-Search.salam
FacetSearch
func FacetSearch(c: Client, uid: str, r: FacetSearchRequest, err &: Error): FacetSearchResultThe example for this item is shown with the ones above: db-meilisearch-Search.salam
SimilarDocuments
func SimilarDocuments(c: Client, uid: str, r: SimilarRequest, err &: Error): SearchResultThe example for this item is shown with the ones above: db-meilisearch-Search.salam
ListWebhooks
func ListWebhooks(c: Client, err &: Error): Vector<Webhook>The example for this item is shown with the ones above: db-meilisearch-CreateWebhook.salam
CreateWebhook
func CreateWebhook(c: Client, url: str, headers: str, err &: Error): WebhookThe example for this item is shown with the ones above: db-meilisearch-CreateWebhook.salam
GetWebhook
func GetWebhook(c: Client, uuid: str, err &: Error): WebhookThe example for this item is shown with the ones above: db-meilisearch-CreateWebhook.salam
UpdateWebhook
func UpdateWebhook(c: Client, uuid: str, url: str, headers: str, err &: Error): WebhookThe example for this item is shown with the ones above: db-meilisearch-CreateWebhook.salam
DeleteWebhook
func DeleteWebhook(c: Client, uuid: str, err &: Error): boolThe example for this item is shown with the ones above: db-meilisearch-CreateWebhook.salam
GetTask
func GetTask(c: Client, uid: i64, err &: Error): TaskThe example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
GetTasks
func GetTasks(c: Client, q: TaskQuery, err &: Error): TaskPageThe example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
WaitForTask
func WaitForTask(c: Client, uid: i64, timeout_ms: int, interval_ms: int, err &: Error): Tasktimeout. A timeout of 0 waits forever.The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
Wait
func Wait(c: Client, info: TaskInfo, err &: Error): TaskThe example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
CancelTasks
func CancelTasks(c: Client, q: TaskQuery, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
DeleteTasks
func DeleteTasks(c: Client, q: TaskQuery, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
GetBatch
func GetBatch(c: Client, uid: i64, err &: Error): BatchThe example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
GetBatches
func GetBatches(c: Client, q: TaskQuery, err &: Error): BatchPageThe example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
GetTaskDocuments
func GetTaskDocuments(c: Client, uid: i64, err &: Error): strtask_file_not_found. Needs the getTaskDocumentsRoute feature.The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
CompactTasks
func CompactTasks(c: Client, err &: Error): TaskCompactionaction_required says. Needs the taskQueueCompactionRoute feature.The example for this item is shown with the ones above: db-meilisearch-GetTasks.salam
GetSettings
func GetSettings(c: Client, uid: str, err &: Error): strimport db.meilisearch
func show(items: Vector<str>):
each s in items:
print s + " "
end
println ""
end
func main:
c := meilisearch.New("http://127.0.0.1:7700", "masterKey")
mut err := meilisearch.Error {}
println meilisearch.GetSettings(c, "movies", err)
meilisearch.Wait(c, meilisearch.UpdateSettings(c, "movies", `{"rankingRules": ["words", "typo"], "stopWords": ["the"]}`, err), err)
println meilisearch.GetSetting(c, "movies", "ranking-rules", err)
meilisearch.Wait(c, meilisearch.UpdateSetting(c, "movies", "pagination", `{"maxTotalHits": 5000}`, err), err)
meilisearch.Wait(c, meilisearch.ResetSetting(c, "movies", "pagination", err), err)
mut rankingRules := Vector {} as Vector<str>
rankingRules.push("words")
rankingRules.push("typo")
rankingRules.push("proximity")
rankingRules.push("attribute")
rankingRules.push("sort")
rankingRules.push("exactness")
meilisearch.Wait(c, meilisearch.UpdateRankingRules(c, "movies", rankingRules, err), err)
show(meilisearch.GetRankingRules(c, "movies", err))
meilisearch.Wait(c, meilisearch.ResetRankingRules(c, "movies", err), err)
mut searchableAttributes := Vector {} as Vector<str>
searchableAttributes.push("title")
searchableAttributes.push("overview")
meilisearch.Wait(c, meilisearch.UpdateSearchableAttributes(c, "movies", searchableAttributes, err), err)
show(meilisearch.GetSearchableAttributes(c, "movies", err))
meilisearch.Wait(c, meilisearch.ResetSearchableAttributes(c, "movies", err), err)
mut displayedAttributes := Vector {} as Vector<str>
displayedAttributes.push("*")
meilisearch.Wait(c, meilisearch.UpdateDisplayedAttributes(c, "movies", displayedAttributes, err), err)
show(meilisearch.GetDisplayedAttributes(c, "movies", err))
meilisearch.Wait(c, meilisearch.ResetDisplayedAttributes(c, "movies", err), err)
mut filterableAttributes := Vector {} as Vector<str>
filterableAttributes.push("genre")
filterableAttributes.push("year")
meilisearch.Wait(c, meilisearch.UpdateFilterableAttributes(c, "movies", filterableAttributes, err), err)
show(meilisearch.GetFilterableAttributes(c, "movies", err))
meilisearch.Wait(c, meilisearch.ResetFilterableAttributes(c, "movies", err), err)
mut sortableAttributes := Vector {} as Vector<str>
sortableAttributes.push("year")
meilisearch.Wait(c, meilisearch.UpdateSortableAttributes(c, "movies", sortableAttributes, err), err)
show(meilisearch.GetSortableAttributes(c, "movies", err))
meilisearch.Wait(c, meilisearch.ResetSortableAttributes(c, "movies", err), err)
mut stopWords := Vector {} as Vector<str>
stopWords.push("the")
stopWords.push("a")
meilisearch.Wait(c, meilisearch.UpdateStopWords(c, "movies", stopWords, err), err)
show(meilisearch.GetStopWords(c, "movies", err))
meilisearch.Wait(c, meilisearch.ResetStopWords(c, "movies", err), err)
mut dictionary := Vector {} as Vector<str>
dictionary.push("J. R. R.")
meilisearch.Wait(c, meilisearch.UpdateDictionary(c, "movies", dictionary, err), err)
show(meilisearch.GetDictionary(c, "movies", err))
meilisearch.Wait(c, meilisearch.ResetDictionary(c, "movies", err), err)
mut separatorTokens := Vector {} as Vector<str>
separatorTokens.push("|")
meilisearch.Wait(c, meilisearch.UpdateSeparatorTokens(c, "movies", separatorTokens, err), err)
show(meilisearch.GetSeparatorTokens(c, "movies", err))
meilisearch.Wait(c, meilisearch.ResetSeparatorTokens(c, "movies", err), err)
mut nonSeparatorTokens := Vector {} as Vector<str>
nonSeparatorTokens.push("@")
meilisearch.Wait(c, meilisearch.UpdateNonSeparatorTokens(c, "movies", nonSeparatorTokens, err), err)
show(meilisearch.GetNonSeparatorTokens(c, "movies", err))
meilisearch.Wait(c, meilisearch.ResetNonSeparatorTokens(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdateDistinctAttribute(c, "movies", "sku", err), err)
println meilisearch.GetDistinctAttribute(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetDistinctAttribute(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdateProximityPrecision(c, "movies", "byAttribute", err), err)
println meilisearch.GetProximityPrecision(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetProximityPrecision(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdatePrefixSearch(c, "movies", "indexingTime", err), err)
println meilisearch.GetPrefixSearch(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetPrefixSearch(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdateSearchCutoffMs(c, "movies", 150, err), err)
println meilisearch.GetSearchCutoffMs(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetSearchCutoffMs(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdateFacetSearch(c, "movies", true, err), err)
println meilisearch.GetFacetSearch(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetFacetSearch(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdateSynonyms(c, "movies", `{"logan": ["wolverine"], "wolverine": ["logan"]}`, err), err)
println meilisearch.GetSynonyms(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetSynonyms(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdateTypoTolerance(c, "movies", `{"minWordSizeForTypos": {"oneTypo": 4, "twoTypos": 10}}`, err), err)
println meilisearch.GetTypoTolerance(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetTypoTolerance(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdatePagination(c, "movies", `{"maxTotalHits": 5000}`, err), err)
println meilisearch.GetPagination(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetPagination(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdateFaceting(c, "movies", `{"maxValuesPerFacet": 200}`, err), err)
println meilisearch.GetFaceting(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetFaceting(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdateEmbedders(c, "movies", `{"default": {"source": "userProvided", "dimensions": 3}}`, err), err)
println meilisearch.GetEmbedders(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetEmbedders(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdateLocalizedAttributes(c, "movies", `[{"attributePatterns": ["*_fa"], "locales": ["fas"]}]`, err), err)
println meilisearch.GetLocalizedAttributes(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetLocalizedAttributes(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.UpdateChat(c, "movies", `{"description": "A movie catalog"}`, err), err)
println meilisearch.GetChat(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetChat(c, "movies", err), err)
meilisearch.Wait(c, meilisearch.ResetSettings(c, "movies", err), err)
println meilisearch.ErrorString(err)
meilisearch.Wait(c, meilisearch.UpdateForeignKeys(c, "movies", `[{"foreignIndexUid": "actors", "fieldName": "actor_ids"}]`, err), err)
println meilisearch.GetForeignKeys(c, "movies", err)
meilisearch.Wait(c, meilisearch.ResetForeignKeys(c, "movies", err), err)
endUpdateSettings
func UpdateSettings(c: Client, uid: str, settings: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetSettings
func ResetSettings(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetSetting
func GetSetting(c: Client, uid: str, name: str, err &: Error): strranking-rules, as raw JSON; for settings newer than this package.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateSetting
func UpdateSetting(c: Client, uid: str, name: str, value: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetSetting
func ResetSetting(c: Client, uid: str, name: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetRankingRules
func GetRankingRules(c: Client, uid: str, err &: Error): Vector<str>The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateRankingRules
func UpdateRankingRules(c: Client, uid: str, items: Vector<str>, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetRankingRules
func ResetRankingRules(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetSearchableAttributes
func GetSearchableAttributes(c: Client, uid: str, err &: Error): Vector<str>The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateSearchableAttributes
func UpdateSearchableAttributes(c: Client, uid: str, items: Vector<str>, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetSearchableAttributes
func ResetSearchableAttributes(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetDisplayedAttributes
func GetDisplayedAttributes(c: Client, uid: str, err &: Error): Vector<str>The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateDisplayedAttributes
func UpdateDisplayedAttributes(c: Client, uid: str, items: Vector<str>, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetDisplayedAttributes
func ResetDisplayedAttributes(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetFilterableAttributes
func GetFilterableAttributes(c: Client, uid: str, err &: Error): Vector<str>The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateFilterableAttributes
func UpdateFilterableAttributes(c: Client, uid: str, items: Vector<str>, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetFilterableAttributes
func ResetFilterableAttributes(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetSortableAttributes
func GetSortableAttributes(c: Client, uid: str, err &: Error): Vector<str>The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateSortableAttributes
func UpdateSortableAttributes(c: Client, uid: str, items: Vector<str>, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetSortableAttributes
func ResetSortableAttributes(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetStopWords
func GetStopWords(c: Client, uid: str, err &: Error): Vector<str>The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateStopWords
func UpdateStopWords(c: Client, uid: str, items: Vector<str>, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetStopWords
func ResetStopWords(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetDictionary
func GetDictionary(c: Client, uid: str, err &: Error): Vector<str>J. R. R..The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateDictionary
func UpdateDictionary(c: Client, uid: str, items: Vector<str>, err &: Error): TaskInfoJ. R. R..The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetDictionary
func ResetDictionary(c: Client, uid: str, err &: Error): TaskInfoJ. R. R. to the default.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetSeparatorTokens
func GetSeparatorTokens(c: Client, uid: str, err &: Error): Vector<str>The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateSeparatorTokens
func UpdateSeparatorTokens(c: Client, uid: str, items: Vector<str>, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetSeparatorTokens
func ResetSeparatorTokens(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetNonSeparatorTokens
func GetNonSeparatorTokens(c: Client, uid: str, err &: Error): Vector<str>The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateNonSeparatorTokens
func UpdateNonSeparatorTokens(c: Client, uid: str, items: Vector<str>, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetNonSeparatorTokens
func ResetNonSeparatorTokens(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetDistinctAttribute
func GetDistinctAttribute(c: Client, uid: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateDistinctAttribute
func UpdateDistinctAttribute(c: Client, uid: str, value: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetDistinctAttribute
func ResetDistinctAttribute(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetProximityPrecision
func GetProximityPrecision(c: Client, uid: str, err &: Error): strbyWord or byAttribute.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateProximityPrecision
func UpdateProximityPrecision(c: Client, uid: str, value: str, err &: Error): TaskInfobyWord or byAttribute.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetProximityPrecision
func ResetProximityPrecision(c: Client, uid: str, err &: Error): TaskInfobyWord or byAttribute to the default.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetPrefixSearch
func GetPrefixSearch(c: Client, uid: str, err &: Error): strindexingTime or disabled.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdatePrefixSearch
func UpdatePrefixSearch(c: Client, uid: str, value: str, err &: Error): TaskInfoindexingTime or disabled.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetPrefixSearch
func ResetPrefixSearch(c: Client, uid: str, err &: Error): TaskInfoindexingTime or disabled to the default.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetSearchCutoffMs
func GetSearchCutoffMs(c: Client, uid: str, err &: Error): i64The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateSearchCutoffMs
func UpdateSearchCutoffMs(c: Client, uid: str, value: i64, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetSearchCutoffMs
func ResetSearchCutoffMs(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetFacetSearch
func GetFacetSearch(c: Client, uid: str, err &: Error): boolThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateFacetSearch
func UpdateFacetSearch(c: Client, uid: str, value: bool, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetFacetSearch
func ResetFacetSearch(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetSynonyms
func GetSynonyms(c: Client, uid: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateSynonyms
func UpdateSynonyms(c: Client, uid: str, value: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetSynonyms
func ResetSynonyms(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetTypoTolerance
func GetTypoTolerance(c: Client, uid: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateTypoTolerance
func UpdateTypoTolerance(c: Client, uid: str, value: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetTypoTolerance
func ResetTypoTolerance(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetPagination
func GetPagination(c: Client, uid: str, err &: Error): strmaxTotalHits, as JSON.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdatePagination
func UpdatePagination(c: Client, uid: str, value: str, err &: Error): TaskInfomaxTotalHits, as JSON.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetPagination
func ResetPagination(c: Client, uid: str, err &: Error): TaskInfomaxTotalHits, as JSON to the default.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetFaceting
func GetFaceting(c: Client, uid: str, err &: Error): strmaxValuesPerFacet, as JSON.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateFaceting
func UpdateFaceting(c: Client, uid: str, value: str, err &: Error): TaskInfomaxValuesPerFacet, as JSON.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetFaceting
func ResetFaceting(c: Client, uid: str, err &: Error): TaskInfomaxValuesPerFacet, as JSON to the default.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetEmbedders
func GetEmbedders(c: Client, uid: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateEmbedders
func UpdateEmbedders(c: Client, uid: str, value: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetEmbedders
func ResetEmbedders(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetLocalizedAttributes
func GetLocalizedAttributes(c: Client, uid: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateLocalizedAttributes
func UpdateLocalizedAttributes(c: Client, uid: str, value: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetLocalizedAttributes
func ResetLocalizedAttributes(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetChat
func GetChat(c: Client, uid: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateChat
func UpdateChat(c: Client, uid: str, value: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetChat
func ResetChat(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
GetForeignKeys
func GetForeignKeys(c: Client, uid: str, err &: Error): strforeignKeys feature.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
UpdateForeignKeys
func UpdateForeignKeys(c: Client, uid: str, value: str, err &: Error): TaskInfoforeignKeys feature.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
ResetForeignKeys
func ResetForeignKeys(c: Client, uid: str, err &: Error): TaskInfoforeignKeys feature to the default.The example for this item is shown with the ones above: db-meilisearch-UpdateSettings.salam
CreateIndex
func CreateIndex(c: Client, uid: str, primary_key: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
GetIndex
func GetIndex(c: Client, uid: str, err &: Error): IndexThe example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
ListIndexes
func ListIndexes(c: Client, offset: int, limit: int, err &: Error): IndexPageThe example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
UpdateIndex
func UpdateIndex(c: Client, uid: str, primary_key: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
RenameIndex
func RenameIndex(c: Client, uid: str, new_uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
DeleteIndex
func DeleteIndex(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
SwapIndexes
func SwapIndexes(c: Client, swaps: Vector<IndexSwap>, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
GetIndexStats
func GetIndexStats(c: Client, uid: str, err &: Error): IndexStatsThe example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
CompactIndex
func CompactIndex(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
ListFields
func ListFields(c: Client, uid: str, q: FieldsQuery, err &: Error): FieldPageThe example for this item is shown with the ones above: db-meilisearch-CreateIndex.salam
New
func New(host: str, api_key: str): Clienthttp:// is added and a trailing slash is dropped; a path after the host, such as https://example.com/search behind a proxy, is kept as a prefix of every route.The example for this item is shown with the ones above: db-meilisearch-Client.salam
WithAgent
func WithAgent(c: Client, agent: str): ClientThe example for this item is shown with the ones above: db-meilisearch-Client.salam
WithTimeout
func WithTimeout(c: Client, timeout_ms: int): ClientThe example for this item is shown with the ones above: db-meilisearch-Client.salam
WithMetadata
func WithMetadata(c: Client, metadata: str): ClientThe example for this item is shown with the ones above: db-meilisearch-Client.salam
Ok
func Ok(err: Error): boolThe example for this item is shown with the ones above: db-meilisearch-Client.salam
ErrorString
func ErrorString(err: Error): strmeilisearch 404 [index_not_found]: Index `movies` not found.; empty when there is no error.The example for this item is shown with the ones above: db-meilisearch-Client.salam
Request
func Request(c: Client, method: str, path: str, body: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-Client.salam
RequestAs
func RequestAs(c: Client, method: str, path: str, content_type: str, body: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-Client.salam
CreateKey
func CreateKey(c: Client, r: KeyRequest, err &: Error): KeyThe example for this item is shown with the ones above: db-meilisearch-CreateKey.salam
GetKey
func GetKey(c: Client, key_or_uid: str, err &: Error): KeyThe example for this item is shown with the ones above: db-meilisearch-CreateKey.salam
GetKeys
func GetKeys(c: Client, offset: int, limit: int, err &: Error): KeyPageThe example for this item is shown with the ones above: db-meilisearch-CreateKey.salam
UpdateKey
func UpdateKey(c: Client, key_or_uid: str, name: str, description: str, err &: Error): KeyThe example for this item is shown with the ones above: db-meilisearch-CreateKey.salam
DeleteKey
func DeleteKey(c: Client, key_or_uid: str, err &: Error): boolThe example for this item is shown with the ones above: db-meilisearch-CreateKey.salam
TenantToken
func TenantToken(api_key_uid: str, api_key: str, search_rules: str, expires_at: i64, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-CreateKey.salam
ListSearchRules
func ListSearchRules(c: Client, q: SearchRuleQuery, err &: Error): SearchRulePagedynamicSearchRules feature.The example for this item is shown with the ones above: db-meilisearch-UpdateSearchRule.salam
GetSearchRule
func GetSearchRule(c: Client, uid: str, err &: Error): SearchRuleThe example for this item is shown with the ones above: db-meilisearch-UpdateSearchRule.salam
UpdateSearchRule
func UpdateSearchRule(c: Client, uid: str, rule: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSearchRule.salam
DeleteSearchRule
func DeleteSearchRule(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSearchRule.salam
DeleteAllSearchRules
func DeleteAllSearchRules(c: Client, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-UpdateSearchRule.salam
Health
func Health(c: Client, err &: Error): stravailable when the server is up.The example for this item is shown with the ones above: db-meilisearch-Client.salam
IsHealthy
func IsHealthy(c: Client): boolThe example for this item is shown with the ones above: db-meilisearch-Client.salam
GetVersion
func GetVersion(c: Client, err &: Error): VersionThe example for this item is shown with the ones above: db-meilisearch-Client.salam
GetStats
func GetStats(c: Client, err &: Error): StatsThe example for this item is shown with the ones above: db-meilisearch-Client.salam
CreateDump
func CreateDump(c: Client, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-Client.salam
CreateSnapshot
func CreateSnapshot(c: Client, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-Client.salam
GetExperimentalFeatures
func GetExperimentalFeatures(c: Client, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-Client.salam
UpdateExperimentalFeatures
func UpdateExperimentalFeatures(c: Client, features: str, err &: Error): str{"metrics": true}.The example for this item is shown with the ones above: db-meilisearch-Client.salam
GetNetwork
func GetNetwork(c: Client, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-Client.salam
UpdateNetwork
func UpdateNetwork(c: Client, network: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-Client.salam
Export
func Export(c: Client, request: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-Client.salam
GetMetrics
func GetMetrics(c: Client, err &: Error): strmetrics feature must be on.The example for this item is shown with the ones above: db-meilisearch-Client.salam
SetStderrLogs
func SetStderrLogs(c: Client, target: str, err &: Error): boolinfo or milli=debug; needs the logsRoute feature.The example for this item is shown with the ones above: db-meilisearch-Client.salam
NetworkControl
func NetworkControl(c: Client, change: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-Client.salam
RenderTemplate
func RenderTemplate(c: Client, query: str, err &: Error): strrenderRoute feature.The example for this item is shown with the ones above: db-meilisearch-Client.salam
ListChatWorkspaces
func ListChatWorkspaces(c: Client, offset: int, limit: int, err &: Error): ChatWorkspacePagechatCompletions feature.The example for this item is shown with the ones above: db-meilisearch-ChatCompletion.salam
GetChatWorkspace
func GetChatWorkspace(c: Client, workspace: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-ChatCompletion.salam
DeleteChatWorkspace
func DeleteChatWorkspace(c: Client, workspace: str, err &: Error): boolThe example for this item is shown with the ones above: db-meilisearch-ChatCompletion.salam
GetChatSettings
func GetChatSettings(c: Client, workspace: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-ChatCompletion.salam
UpdateChatSettings
func UpdateChatSettings(c: Client, workspace: str, settings: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-ChatCompletion.salam
ResetChatSettings
func ResetChatSettings(c: Client, workspace: str, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-ChatCompletion.salam
ChatCompletion
func ChatCompletion(c: Client, workspace: str, request: str, err &: Error): str"stream": true the whole stream of data: lines comes back at once.The example for this item is shown with the ones above: db-meilisearch-ChatCompletion.salam
AddDocuments
func AddDocuments(c: Client, uid: str, documents: str, primary_key: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
UpdateDocuments
func UpdateDocuments(c: Client, uid: str, documents: str, primary_key: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
AddDocumentsNdjson
func AddDocumentsNdjson(c: Client, uid: str, documents: str, primary_key: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
UpdateDocumentsNdjson
func UpdateDocumentsNdjson(c: Client, uid: str, documents: str, primary_key: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
AddDocumentsCsv
func AddDocumentsCsv(c: Client, uid: str, documents: str, primary_key: str, delimiter: str, err &: Error): TaskInfoyear:number in the header for a number column.The example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
UpdateDocumentsCsv
func UpdateDocumentsCsv(c: Client, uid: str, documents: str, primary_key: str, delimiter: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
AddDocumentsWith
func AddDocumentsWith(c: Client, uid: str, documents: str, o: DocumentOptions, err &: Error): TaskInfoskip_creation.The example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
AddDocumentsInBatches
func AddDocumentsInBatches(c: Client, uid: str, documents: Vector<str>, batch_size: int, primary_key: str, err &: Error): Vector<TaskInfo>The example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
AddDocumentsOf
func AddDocumentsOf<T>(c: Client, uid: str, documents: Vector<T>, primary_key: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
GetDocument
func GetDocument(c: Client, uid: str, id: str, fields: Vector<str>, err &: Error): strThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
GetDocumentWith
func GetDocumentWith(c: Client, uid: str, id: str, q: DocumentsQuery, err &: Error): strDocumentsQuery.The example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
GetDocumentAs
func GetDocumentAs<T>(c: Client, uid: str, id: str, out &: T, err &: Error): boolThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
GetDocuments
func GetDocuments(c: Client, uid: str, q: DocumentsQuery, err &: Error): PageThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
DocumentsAs
func DocumentsAs<T>(p: Page, out &: Vector<T>, err &: Error): boolThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
DeleteDocument
func DeleteDocument(c: Client, uid: str, id: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
DeleteDocuments
func DeleteDocuments(c: Client, uid: str, ids: Vector<str>, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
DeleteDocumentsByFilter
func DeleteDocumentsByFilter(c: Client, uid: str, filter: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
DeleteAllDocuments
func DeleteAllDocuments(c: Client, uid: str, err &: Error): TaskInfoThe example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam
UpdateDocumentsByFunction
func UpdateDocumentsByFunction(c: Client, uid: str, function: str, filter: str, context: str, err &: Error): TaskInfoeditDocumentsByFunction feature.The example for this item is shown with the ones above: db-meilisearch-AddDocuments.salam