Databases
Meilisearch Search Engine Management in VS Code
Overview
Section titled “Overview”Meilisearch is an open-source search engine that stores JSON documents in indexes and returns relevant results as you type. You work with it over an HTTP API, and each index has its own settings that decide which attributes are searchable, filterable, and sortable.
Connecting
Section titled “Connecting”To connect to Meilisearch in DBCode:
- Open the DBCode Extension: Launch Visual Studio Code and open the DBCode extension.
- Add a New Connection: Click on the “Add Connection” icon.
- Complete connection form: Select Meilisearch as the database type and enter:
-
Host and port (default
7700) -
SSL/TLS settings (if required)
-
An API key: the master key, or an API key with these actions. Leave it empty for a server started without a master key. You can also select a Command authentication profile instead of storing the key directly.
- Browsing and search:
indexes.get,documents.get,search,stats.get - Editing:
documents.add,documents.delete,settings.update,indexes.delete,tasks.get(andtasks.cancelfor Stop) - The Keys folder:
keys.get - Monitoring:
tasks.getandversion
Keys limited to specific indexes work, but the server version is not shown.
- Browsing and search:
-
- Connect: Click save to establish your connection.
- Start Managing Your Data: Browse indexes, documents, and keys.
For Meilisearch Cloud, use your project URL’s host name, port 443, and turn SSL on.
For detailed instructions on connecting, refer to the Connect article.
Meilisearch Features in DBCode
Section titled “Meilisearch Features in DBCode”Browsing and editing documents
Section titled “Browsing and editing documents”- Indexes as tables: Each index appears as a table. Open one to page through its documents in the grid.
- Filtering and sorting: Filter and sort in the grid on attributes listed in the index’s
filterableAttributesandsortableAttributes. If an attribute is missing, the error from Meilisearch tells you which one to add. “Contains” filters need Meilisearch’scontainsFilterexperimental feature turned on, and “ends with” filters are not available. - Editing: Insert, update, and delete documents in the grid. Documents are matched by their primary key: you set it when you insert a document, and it cannot be changed afterwards (DBCode refuses the change when you save). Meilisearch only accepts document ids made of letters, digits, hyphens, and underscores.
- Truncate and drop: Right-click an index to remove all of its documents with Truncate, or delete the index with Drop.
Search queries
Section titled “Search queries”The query editor runs JSON search statements. Every key except index is passed to Meilisearch as a search parameter:
{ "index": "movies", "q": "batman", "filter": "year > 2000", "sort": ["year:desc"] }If a search sets no limit, DBCode applies your usual row limit. Search results are capped by the index’s pagination.maxTotalHits setting (1000 by default). Results in the editor are read-only; to edit documents, open the index in the grid.
Index settings
Section titled “Index settings”Right-click an index and choose Script > CREATE (DDL) to open its current settings as a statement you can run. Change the settings and run it to apply them. Meilisearch applies settings in the background, and DBCode waits for the change to finish before showing the result. Embedders are not included in the script.
Keys and monitoring
Section titled “Keys and monitoring”- Keys: API keys are listed read-only, and their secret values are never shown. The Keys folder is empty when the server has no master key or your API key is not allowed to list keys.
- Monitoring: See the task queue and server statistics.
- Read-only connections: Mark a connection read-only to block every write, including document edits and settings changes, while still allowing searches and browsing.
By using Meilisearch with DBCode, you can manage your search indexes directly within Visual Studio Code.
For more information about Meilisearch, check out Meilisearch.