Manages Meilisearch indexes.
Summary
Functions
Triggers compaction of a specific index.
Triggers compaction of a specific index, raising on error.
Creates a new index.
Creates a new index, raising on error.
Deletes an index.
Deletes an index, raising on error.
Retrieves a single index.
Retrieves a single index, raising on error.
Lists all indexes.
Lists all indexes, raising on error.
Gets stats of a specific index.
Gets stats of a specific index, raising on error.
Swaps the contents of two or more indexes.
Swaps the contents of indexes, raising on error.
Updates an index (currently, only the primaryKey can be updated).
Updates an index, raising on error.
Functions
Triggers compaction of a specific index.
Examples
Meili.Index.compact("movies")
Meili.Index.compact(client, "movies")
Triggers compaction of a specific index, raising on error.
Creates a new index.
Options can be a primary key string, a keyword list, or a map.
Examples
Meili.Index.create("movies")
Meili.Index.create("movies", "id")
Meili.Index.create("movies", primary_key: "id")
Meili.Index.create(client, "movies", primary_key: "id")
Creates a new index, raising on error.
Deletes an index.
Examples
Meili.Index.delete("movies")
Meili.Index.delete(client, "movies")
Deletes an index, raising on error.
Retrieves a single index.
Examples
Meili.Index.get("movies")
Meili.Index.get(client, "movies")
Retrieves a single index, raising on error.
Lists all indexes.
Supports optional query params:
limit: The maximum number of indexes to return.offset: The number of indexes to skip.
Examples
Meili.Index.list()
Meili.Index.list(limit: 10)
Meili.Index.list(client, limit: 10)
Lists all indexes, raising on error.
Gets stats of a specific index.
Examples
Meili.Index.stats("movies")
Meili.Index.stats(client, "movies")
Gets stats of a specific index, raising on error.
Swaps the contents of two or more indexes.
Examples
Meili.Index.swap([%{indexes: ["movies_a", "movies_b"]}])
Meili.Index.swap(client, [%{indexes: ["movies_a", "movies_b"]}])
Swaps the contents of indexes, raising on error.
Updates an index (currently, only the primaryKey can be updated).
Examples
Meili.Index.update("movies", "new_id")
Meili.Index.update("movies", primary_key: "new_id")
Meili.Index.update(client, "movies", primary_key: "new_id")
Updates an index, raising on error.