Discover Packages
github.com/meilisearch/meilisearch-go
examples
create_index_settings
command
Version:
v0.34.2
Opens a new window with list of versions in this module.
Published: Nov 16, 2025
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Index Creation and Settings Example
This example shows how to create an index and configure its settings for better search.
What it does
Create an "articles" index with "id" as primary key
Configure comprehensive settings:
Searchable attributes (title, content, author, tags)
Displayed attributes (what fields to return)
Filterable attributes (what can be used in filters)
Sortable attributes (what can be sorted)
Ranking rules (how to order results)
Stop words (common words to ignore)
Synonyms (alternative words)
Typo tolerance (allow spelling mistakes)
Pagination limits
Verify the settings were applied
Searchable : title, content, author, tags
Filterable : category, author, publish_date, status, featured
Sortable : publish_date, title, author
Ranking rules : words, typo, proximity, attribute, sort, exactness
Stop words : the, a, an, and, or, but, in, on, at, to, for, of, with, by
Synonyms : programming = coding/development, javascript = js/ecmascript, golang = go
Typo tolerance : 1 typo for 5+ letter words, 2 typos for 9+ letter words
Max results : 1000 per search
Configuration
export MEILI_HOST="http://localhost:7700"
export MEILI_API_KEY="your-api-key"
Run it
go run ./examples/create_index_settings
The example will create an "articles" index, configure comprehensive settings, add sample articles, and demonstrate how the settings improve search results.
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.