db/meilisearch
A Meilisearch client: indexes, documents, full text, faceted, hybrid and federated search, settings, tasks and API keys.
import db.meilisearch
Meilisearch is a fast search engine with typo tolerance, filters, facets and AI powered hybrid search. This package speaks 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. The examples need a running server, so they are only checked.
Every call takes an Error as its last argument and fills it when something fails; check it with Ok. Writes do not happen at once: they return a TaskInfo and Meilisearch applies them in order, so call Wait when the next step needs the change. Search hits and documents come back as raw JSON text; read them into your own structs with HitsAs and GetDocumentAs. For a route with no function of its own, use Request.
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. |
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()
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. |
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. |
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. |
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. |
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. |
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. |
The example for this item is shown with the ones above: db-meilisearch-Search.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. |
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
endStats
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
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. |
The example for this item is shown with the ones above: db-meilisearch-Client.salam
Error
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
TaskInfo
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. |
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.details, one.stats, one.progress, one.duration, one.started_at, one.finished_at
end
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. |
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
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. |
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
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
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.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. |
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
DocumentsQuery
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. |
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)
endConstants 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
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
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
Functions
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)
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
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
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
New
func New(host: str, api_key: str): Clienthttp:// is added and a trailing slash is dropped.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
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
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
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
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
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
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
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