From 1ddccd76b5e4a194b35c2deb69181049a8f4dd90 Mon Sep 17 00:00:00 2001 From: Quentin de Quelen Date: Mon, 9 Mar 2026 20:56:24 +0100 Subject: [PATCH 1/4] Add Getting started section with SDKs, frameworks, and integrations Import the Getting started tab with overview, features catalog, 10 SDK quick starts, 4 framework guides, 4 instant-meilisearch guides, and 6 integration guides. Fix ~120 broken internal links from the import and expand features page to cover all Meilisearch capabilities. Entire-Checkpoint: 9c68757644a6 --- docs.json | 56 ++++ getting_started/features.mdx | 209 +++++++++++++ getting_started/frameworks/laravel.mdx | 191 ++++++++++++ getting_started/frameworks/rails.mdx | 126 ++++++++ getting_started/frameworks/strapi.mdx | 132 ++++++++ getting_started/frameworks/symfony.mdx | 213 +++++++++++++ .../instant_meilisearch/docsearch.mdx | 218 ++++++++++++++ .../instant_meilisearch/javascript.mdx | 124 ++++++++ getting_started/instant_meilisearch/react.mdx | 128 ++++++++ getting_started/instant_meilisearch/vue.mdx | 135 +++++++++ getting_started/integrations/firebase.mdx | 126 ++++++++ getting_started/integrations/gatsby.mdx | 223 ++++++++++++++ .../integrations/meilisearch_importer.mdx | 186 ++++++++++++ getting_started/integrations/meilisync.mdx | 283 ++++++++++++++++++ getting_started/integrations/postman.mdx | 51 ++++ getting_started/integrations/vercel.mdx | 115 +++++++ getting_started/overview.mdx | 57 ++++ getting_started/sdks/dart.mdx | 190 ++++++++++++ getting_started/sdks/dotnet.mdx | 155 ++++++++++ getting_started/sdks/go.mdx | 155 ++++++++++ getting_started/sdks/java.mdx | 176 +++++++++++ getting_started/sdks/javascript.mdx | 133 ++++++++ getting_started/sdks/php.mdx | 154 ++++++++++ getting_started/sdks/python.mdx | 128 ++++++++ getting_started/sdks/ruby.mdx | 156 ++++++++++ getting_started/sdks/rust.mdx | 178 +++++++++++ getting_started/sdks/swift.mdx | 172 +++++++++++ 27 files changed, 4170 insertions(+) create mode 100644 getting_started/features.mdx create mode 100644 getting_started/frameworks/laravel.mdx create mode 100644 getting_started/frameworks/rails.mdx create mode 100644 getting_started/frameworks/strapi.mdx create mode 100644 getting_started/frameworks/symfony.mdx create mode 100644 getting_started/instant_meilisearch/docsearch.mdx create mode 100644 getting_started/instant_meilisearch/javascript.mdx create mode 100644 getting_started/instant_meilisearch/react.mdx create mode 100644 getting_started/instant_meilisearch/vue.mdx create mode 100644 getting_started/integrations/firebase.mdx create mode 100644 getting_started/integrations/gatsby.mdx create mode 100644 getting_started/integrations/meilisearch_importer.mdx create mode 100644 getting_started/integrations/meilisync.mdx create mode 100644 getting_started/integrations/postman.mdx create mode 100644 getting_started/integrations/vercel.mdx create mode 100644 getting_started/overview.mdx create mode 100644 getting_started/sdks/dart.mdx create mode 100644 getting_started/sdks/dotnet.mdx create mode 100644 getting_started/sdks/go.mdx create mode 100644 getting_started/sdks/java.mdx create mode 100644 getting_started/sdks/javascript.mdx create mode 100644 getting_started/sdks/php.mdx create mode 100644 getting_started/sdks/python.mdx create mode 100644 getting_started/sdks/ruby.mdx create mode 100644 getting_started/sdks/rust.mdx create mode 100644 getting_started/sdks/swift.mdx diff --git a/docs.json b/docs.json index 43ec6dbeb..728a4bfad 100644 --- a/docs.json +++ b/docs.json @@ -155,6 +155,62 @@ { "version": "latest", "tabs": [ + { + "tab": "Getting started", + "groups": [ + { + "group": "Introduction", + "pages": [ + "getting_started/overview", + "getting_started/features" + ] + }, + { + "group": "Back-end SDKs", + "pages": [ + "getting_started/sdks/javascript", + "getting_started/sdks/python", + "getting_started/sdks/php", + "getting_started/sdks/ruby", + "getting_started/sdks/go", + "getting_started/sdks/rust", + "getting_started/sdks/java", + "getting_started/sdks/dotnet", + "getting_started/sdks/swift", + "getting_started/sdks/dart" + ] + }, + { + "group": "Instant-meilisearch", + "pages": [ + "getting_started/instant_meilisearch/javascript", + "getting_started/instant_meilisearch/react", + "getting_started/instant_meilisearch/vue", + "getting_started/instant_meilisearch/docsearch" + ] + }, + { + "group": "Framework integrations", + "pages": [ + "getting_started/frameworks/laravel", + "getting_started/frameworks/strapi", + "getting_started/frameworks/rails", + "getting_started/frameworks/symfony" + ] + }, + { + "group": "Integrations", + "pages": [ + "getting_started/integrations/firebase", + "getting_started/integrations/gatsby", + "getting_started/integrations/vercel", + "getting_started/integrations/postman", + "getting_started/integrations/meilisearch_importer", + "getting_started/integrations/meilisync" + ] + } + ] + }, { "tab": "Learn", "groups": [ diff --git a/getting_started/features.mdx b/getting_started/features.mdx new file mode 100644 index 000000000..8ae2b0b9e --- /dev/null +++ b/getting_started/features.mdx @@ -0,0 +1,209 @@ +--- +title: Features +sidebarTitle: Features +description: Explore all Meilisearch capabilities - from full-text search to AI-powered semantic search. +--- + +Meilisearch provides a comprehensive set of search features designed to deliver fast, relevant results for any use case. + +## Search capabilities + +### Full-text search + +Lightning-fast keyword search with typo tolerance and customizable relevancy. + +| Feature | Description | +|---------|-------------| +| Sub-50ms responses | Fast search regardless of dataset size | +| [Typo tolerance](/learn/relevancy/typo_tolerance_settings) | Get relevant results even with spelling mistakes | +| [Ranking rules](/learn/relevancy/ranking_rules) | 6 default rules plus custom ranking | +| [Ranking score](/learn/relevancy/ranking_score) | Relevancy scores with optional detailed breakdown | +| [Synonyms](/learn/relevancy/synonyms) | Define equivalent terms for better recall | +| [Stop words](/reference/api/settings/get-stopwords) | Ignore common words like "the" or "and" | +| [Distinct attribute](/learn/relevancy/distinct_attribute) | Deduplicate results by a specific field | +| [Prefix search](/learn/engine/prefix) | Results update as users type | +| [Matching strategy](/reference/api/search/search-with-post#body-matching-strategy) | Control how query terms are matched: `last`, `all`, or `frequency` | +| [Phrase search](/reference/api/search/search-with-post) | Use double quotes to search for an exact phrase | +| [Negative search](/reference/api/search/search-with-post) | Exclude terms from results using the minus operator | +| [Placeholder search](/reference/api/search/search-with-post) | Return all results when the query is empty | + +### Querying and result formatting + +| Feature | Description | +|---------|-------------| +| [Highlighting](/reference/api/search/search-with-post#highlight-tags) | Emphasize query matches in results with customizable tags | +| [Cropping](/reference/api/search/search-with-post#body-attributes-to-crop) | Return only the relevant portion of long text fields | +| [Matches position](/reference/api/search/search-with-post#body-show-matches-position) | Get byte positions and lengths of matched terms | +| [Search cutoff](/reference/api/settings/get-searchcutoffms) | Set a maximum time limit for search queries | +| [Tokenization](/learn/indexing/tokenization) | Customize how queries are broken into tokens, with custom separators and dictionaries | + +### AI-powered search + +Semantic and hybrid search using vector embeddings for meaning-based results. + +| Feature | Description | +|---------|-------------| +| [Hybrid search](/learn/ai_powered_search/getting_started_with_ai_search) | Combine keyword and semantic search | +| [Embedders](/learn/ai_powered_search/choose_an_embedder) | OpenAI, Hugging Face, Cohere, Mistral, Voyage, Gemini, Cloudflare, Ollama, and custom REST | +| [Similar documents](/learn/ai_powered_search/retrieve_related_search_results) | Find related content automatically | +| [Image search](/learn/ai_powered_search/image_search_with_multimodal_embeddings) | Search images with multimodal embeddings | +| [Multi-embedder](/reference/api/settings/get-embedders) | Multiple embedding models on the same document | +| [User-provided vectors](/learn/ai_powered_search/search_with_user_provided_embeddings) | Bring your own pre-generated embeddings | + +### Conversational search + +Build chat interfaces powered by your search data with LLM integration. + +| Feature | Description | +|---------|-------------| +| [Chat completions](/learn/chat/getting_started_with_chat) | RAG-powered conversational search | +| [LLM providers](/learn/chat/chat_tooling_reference) | OpenAI, Azure OpenAI, Mistral, Google Gemini, vLLM, and custom providers | +| [Streaming responses](/reference/api/chats/chat-completions) | Stream chat responses in real time | +| [Chat workspaces](/reference/api/chats/get-chat-settings) | Configure chat settings per index | + +### Personalization + +| Feature | Description | +|---------|-------------| +| [User preference ranking](/reference/api/search/search-with-post#body-personalize-one-of-1) | Re-rank results based on individual user preferences using AI embeddings | +| Real-time adaptation | Adjust results as user preferences evolve | + +### Filtering and faceting + +Refine search results with powerful filters and build faceted navigation. + +| Feature | Description | +|---------|-------------| +| [Filters](/learn/filtering_and_sorting/filter_search_results) | Filter by any attribute with complex expressions (AND/OR) | +| [Facets](/learn/filtering_and_sorting/search_with_facet_filters) | Build faceted navigation interfaces | +| [Facet types](/learn/filtering_and_sorting/facet_types) | AND/OR operators, numeric, boolean, and date facets | +| [Sorting](/learn/filtering_and_sorting/sort_search_results) | Sort results by any field | +| [Geo search](/learn/filtering_and_sorting/geosearch) | Geo radius, bounding box, geo sorting, and distance calculation | + +### Multi-search and federation + +Query multiple indexes in a single request for complex search scenarios. + +| Feature | Description | +|---------|-------------| +| [Multi-search](/learn/multi_search/multi_search_vs_federated_search) | Query multiple indexes at once | +| [Federated search](/learn/multi_search/performing_federated_search) | Merge results from multiple sources with configurable weights | + +## Scaling + +Scale Meilisearch horizontally across multiple instances or optimize resource usage on a single node. + +| Feature | Description | +|---------|-------------| +| [Sharding](/learn/multi_search/implement_sharding) | Distribute documents across multiple instances for horizontal scaling | +| [Replication](/reference/api/experimental-features/get-network-topology) | Replicate data across multiple instances for high availability | +| [Remote federation](/reference/api/experimental-features/get-network-topology) | Federate search across multiple Meilisearch instances | +| Memory mapping | Efficient memory usage through memory-mapped storage | + +## Database + +### Document database + +| Feature | Description | +|---------|-------------| +| [Schemaless](/learn/getting_started/documents) | Index documents without a predefined schema | +| [Documents](/learn/getting_started/documents) | Add, replace, update, and delete documents | +| [Delete by filter](/reference/api/documents/delete-documents-by-filter) | Delete documents matching a filter expression | +| [Update by function](/reference/api/documents/edit-documents-by-function) | Partial updates to documents using functions | +| [Searchable attributes](/learn/relevancy/displayed_searchable_attributes) | Configure which fields are searchable and their priority | +| [Displayed attributes](/learn/relevancy/displayed_searchable_attributes) | Control which fields are returned in results | +| [Filterable attributes](/learn/filtering_and_sorting/filter_search_results) | Define which fields can be used in filters | +| [Sortable attributes](/learn/filtering_and_sorting/sort_search_results) | Define which fields can be used for sorting | +| [Index swap](/reference/api/indexes/swap-indexes) | Swap indexes to perform updates without downtime | + +### Vector database + +| Feature | Description | +|---------|-------------| +| [Similar documents](/learn/ai_powered_search/retrieve_related_search_results) | Find semantically similar documents using vector embeddings | +| [Binary quantization](/reference/api/settings/get-embedders) | Compress vectors to save storage | +| DiskANN | Disk-based approximate nearest neighbors for large datasets | +| [Auto embedding](/reference/api/settings/get-embedders) | Automatically generate embeddings without manual input | + +## Platform features + +### Security + +Protect your data with API keys and multi-tenant access control. + +| Feature | Description | +|---------|-------------| +| [API keys](/learn/security/basic_security) | Admin, search, and chat key types for different access levels | +| [Tenant tokens](/learn/security/multitenancy_tenant_tokens) | Secure multi-tenant applications with document-level access control | +| [Search rules](/learn/security/tenant_token_reference) | Restrict which documents users can access | + +### Tasks and monitoring + +Monitor indexing operations and receive notifications. + +| Feature | Description | +|---------|-------------| +| [Task management](/learn/async/working_with_tasks) | Track and manage async operations | +| [Batches](/learn/async/asynchronous_operations#task-batches) | Automatic task batching for efficient processing | +| [Webhooks](/learn/async/task_webhook) | Get notified when tasks complete | +| Diff indexing | Only index differences between datasets | + +### Analytics (Cloud) + +Track search behavior and optimize relevancy with built-in analytics. + +| Feature | Description | +|---------|-------------| +| [Search analytics](/learn/analytics/configure_analytics_events) | Monitor search patterns, no-result rates, and top queries | +| [Click tracking](/learn/analytics/bind_events_user) | Track which results users engage with | +| [Metrics reference](/learn/analytics/analytics_metrics_reference) | Click-through rate, conversion rate, average click position | +| Monitoring | Search latency, indexing latency, bandwidth, and API health | + +### Pagination + +| Feature | Description | +|---------|-------------| +| [Pagination](/guides/front_end/pagination) | Offset/limit and cursor-based pagination | + +## Language support + +Meilisearch provides optimized support for many languages: + +- **Latin-based languages**: English, French, Spanish, German, Italian, Portuguese, etc. +- **CJK**: Chinese, Japanese, Korean with specialized tokenization +- **RTL languages**: Hebrew, Arabic +- **Others**: Thai, Greek, and more + +[See full language support →](/learn/resources/language) + +## Cloud features + +These features are available exclusively on Meilisearch Cloud. + +| Feature | Description | +|---------|-------------| +| Crawler | Crawl web pages with JS rendering, DocSearch mode, and schema extraction | +| [Search preview](/learn/getting_started/search_preview) | Visual search interface with filtering, sorting, and document CRUD | +| [Teams](/learn/teams/teams) | Organize projects and members into team workspaces | +| [Enterprise SSO/SCIM](/learn/self_hosted/enterprise_edition) | SAML 2.0 SSO and automated user provisioning | +| Autoscale disk | Automatically scale storage as data grows | +| Automatic backups | Scheduled backups for data safety | +| One-click upgrade | Upgrade Meilisearch version with a single click | +| Up to 99.999% SLA | Industry-leading service level agreement | + +## Self-hosting + +| Feature | Description | +|---------|-------------| +| [Configuration](/learn/self_hosted/configure_meilisearch_at_launch) | CLI flags and environment variables | +| [Snapshots](/learn/data_backup/snapshots) | Full binary copies for fast restoration | +| [Dumps](/learn/data_backup/dumps) | Portable JSON exports for migration | +| [Master key](/learn/security/basic_security) | Secure your instance with a master key | + +## Integration options + +| Option | Description | +|--------|-------------| +| [REST API](/reference/api/openapi) | Direct HTTP integration | +| [Official SDKs](/learn/resources/sdks) | 10+ language SDKs | +| [Frameworks](/learn/resources/sdks#framework-integrations) | Laravel, Rails, Strapi, Symfony | diff --git a/getting_started/frameworks/laravel.mdx b/getting_started/frameworks/laravel.mdx new file mode 100644 index 000000000..9a0fbbe2a --- /dev/null +++ b/getting_started/frameworks/laravel.mdx @@ -0,0 +1,191 @@ +--- +title: Laravel Scout guide +sidebarTitle: Laravel Scout +description: Learn how to use Meilisearch with Laravel Scout. +sidebarDepth: 3 +--- + +In this guide, you will see how to setup [Laravel Scout](https://laravel.com/docs/10.x/scout) to use Meilisearch in your Laravel 10 application. + +## Prerequisites + +Before you start, make sure you have the following installed on your machine: + +- PHP +- [Composer](https://getcomposer.org/) + +You will also need a Laravel application. If you don't have one, you can create a new one by running the following command: + +```sh +composer create-project laravel/laravel my-application +``` + +## Installing Laravel Scout + +Laravel comes with out-of-the-box full-text search capabilities via Laravel Scout. + +To enable it, navigate to your Laravel application directory and install Scout via the Composer package manager: + +```sh +composer require laravel/scout +``` + +After installing Scout, you need to publish the Scout configuration file. You can do this by running the following `artisan` command: + +```sh +php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider" +``` + +This command should create a new configuration file in your application directory: `config/scout.php`. + +## Configuring the Laravel Scout driver + +Now you need to configure Laravel Scout to use the Meilisearch driver. First, install the dependencies required to use Scout with Meilisearch via Composer: + +```sh +composer require meilisearch/meilisearch-php http-interop/http-factory-guzzle +``` + +Then, update the environment variables in your `.env` file: + +```sh +SCOUT_DRIVER=meilisearch +# Use the host below if you're running Meilisearch via Laravel Sail +MEILISEARCH_HOST=http://meilisearch:7700 +MEILISEARCH_KEY=masterKey +``` + +### Local development + +Laravel’s official Docker development environment, Laravel Sail, comes with a Meilisearch service out-of-the-box. Please note that when running Meilisearch via Sail, Meilisearch’s host is `http://meilisearch:7700` (instead of say, `http://localhost:7700`). + + +Check out Docker [Bridge network driver](https://docs.docker.com/network/drivers/bridge/#differences-between-user-defined-bridges-and-the-default-bridge) documentation for further detail. + + +### Running in production + +For production use cases, we recommend using a managed Meilisearch via [Meilisearch Cloud](https://www.meilisearch.com/cloud?utm_campaign=laravel&utm_source=docs&utm_medium=laravel-scout-guide). On Meilisearch Cloud, you can find your host URL in your project settings. + + +Read the [Meilisearch Cloud quick start](/getting_started/overview). + + +## Making Eloquent models searchable + +With Scout installed and configured, add the `Laravel\Scout\Searchable` trait to your Eloquent models to make them searchable. This trait will use Laravel’s model observers to keep the data in your model in sync with Meilisearch. + +Here’s an example model: + +```php +belongsTo(Company::class); + } + + public function toSearchableArray(): array + { + // All model attributes are made searchable + $array = $this->toArray(); + + // Then we add some additional fields + $array['organization_id'] = $this->company->organization->id; + $array['company_name'] = $this->company->name; + $array['company_url'] = $this->company->url; + + return $array; + } +} +``` + +## Configuring filterable and sortable attributes + +Configure which attributes are [filterable](/learn/filtering_and_sorting/filter_search_results) and [sortable](/learn/filtering_and_sorting/sort_search_results) via your Meilisearch index settings. + +In Laravel, you can configure your index settings via the `config/scout.php` file: + +```php + [ + 'host' => env('MEILISEARCH_HOST', 'https://edge.meilisearch.com'), + 'key' => env('MEILISEARCH_KEY'), + 'index-settings' => [ + Contact::class => [ + 'filterableAttributes' => ['organization_id'], + 'sortableAttributes' => ['name', 'company_name'] + ], + ], + ], +]; +``` + +The example above updates Meilisearch index settings for the `Contact` model: + +- it makes the `organization_id` field filterable +- it makes the `name` and `company_name` fields sortable + +After changing your index settings, you will need to synchronize your Scout index settings. + +## Synchronizing your index settings + +To synchronize your index settings, run the following command: + +```sh +php artisan scout:sync-index-settings +``` + +## Example usage + +You built an example application to demonstrate how to use Meilisearch with Laravel Scout. It showcases an app-wide search in a CRM (Customer Relationship Management) application. + + + + Laravel Scout example application + + + +This demo application uses the following features: + +- [Multi-search](/reference/api/search/search-with-post) (search across multiple indexes) +- [Multi-tenancy](/learn/security/multitenancy_tenant_tokens) +- [Filtering](/learn/filtering_and_sorting/filter_search_results) +- [Sorting](/learn/filtering_and_sorting/sort_search_results) + +Of course, the code is open-sourced on [Github](https://github.com/meilisearch/saas-demo). 🎉 diff --git a/getting_started/frameworks/rails.mdx b/getting_started/frameworks/rails.mdx new file mode 100644 index 000000000..fbf78f791 --- /dev/null +++ b/getting_started/frameworks/rails.mdx @@ -0,0 +1,126 @@ +--- +title: Ruby on Rails quick start +sidebarTitle: Ruby on Rails +description: Integrate Meilisearch into your Ruby on Rails app. +--- + +Integrate Meilisearch into your Ruby on Rails app. + +## 1. Create a Meilisearch project + +[Create a project](https://cloud.meilisearch.com) in the Meilisearch Cloud dashboard. Check out our [getting started guide](/getting_started/overview) for step-by-step instructions. + +If you prefer to use the self-hosted version of Meilisearch, you can follow the [quick start](/learn/self_hosted/getting_started_with_self_hosted_meilisearch) tutorial. + +## 2. Create a Rails app + +Ensure your environment uses at least Ruby 2.7.0 and Rails 6.1. + +```bash +rails new blog +``` + +## 3. Install the meilisearch-rails gem + +Navigate to your Rails app and install the `meilisearch-rails` gem. + +```bash +bundle add meilisearch-rails +``` + +## 4. Add your Meilisearch credentials + +Run the following command to create a `config/initializers/meilisearch.rb` file. + +```bash +bin/rails meilisearch:install +``` + +Then add your Meilisearch URL and [Default Admin API Key](/learn/security/basic_security#obtaining-api-keys). On Meilisearch Cloud, you can find your credentials in your project settings. + +```Ruby +MeiliSearch::Rails.configuration = { + meilisearch_url: '', + meilisearch_api_key: '' +} +``` + +## 5. Generate the model and run the database migration + +Create an example `Article` model and generate the migration files. + +```bash +bin/rails generate model Article title:string body:text + +bin/rails db:migrate +``` + +## 6. Index your model into Meilisearch + +Include the `MeiliSearch::Rails` module and the `meilisearch` block. + +```Ruby +class Article < ApplicationRecord + include MeiliSearch::Rails + + meilisearch do + # index settings + # all attributes will be sent to Meilisearch if block is left empty + end +end +``` + +This code creates an `Article` index and adds search capabilities to your `Article` model. + +Once configured, `meilisearch-rails` automatically syncs your table data with your Meilisearch instance. + +## 7. Create new records in the database + +Use the Rails console to create new entries in the database. + +```bash +bin/rails console +``` + +```Ruby +# Use a loop to create and save 5 unique articles with predefined titles and bodies +titles = ["Welcome to Rails", "Exploring Rails", "Advanced Rails", "Rails Tips", "Rails in Production"] +bodies = [ + "This is your first step into Ruby on Rails.", + "Dive deeper into the Rails framework.", + "Explore advanced features of Rails.", + "Quick tips for Rails developers.", + "Managing Rails applications in production environments." +] + +titles.each_with_index do |title, index| + article = Article.new(title: title, body: bodies[index]) + article.save # Saves the entry to the database +end +``` + +## 8. Start searching + +### Backend search + +The backend search returns ORM-compliant objects reloaded from your database. + +```Ruby +# Meilisearch is typo-tolerant: +hits = Article.search('deepre') +hits.first +``` + +We strongly recommend using the frontend search to enjoy the swift and responsive search-as-you-type experience. + +### Frontend search + +For testing purposes, you can explore the records using our built-in [search preview](/getting_started/overview). + +![Searching through Rails table data with Meilisearch search preview UI](/assets/images/rails_quick_start/rails-qs-search-preview.gif) + +We also provide resources to help you quickly build your own [frontend interface](/getting_started/instant_meilisearch/javascript). + +## Next steps + +When you're ready to use your own data, make sure to configure your [index settings](/reference/api/settings/list-all-settings) first to follow [best practices](/learn/indexing/indexing_best_practices). For a full configuration example, see the [meilisearch-rails gem README](https://github.com/meilisearch/meilisearch-rails?tab=readme-ov-file#%EF%B8%8F-settings). diff --git a/getting_started/frameworks/strapi.mdx b/getting_started/frameworks/strapi.mdx new file mode 100644 index 000000000..8431c3fe9 --- /dev/null +++ b/getting_started/frameworks/strapi.mdx @@ -0,0 +1,132 @@ +--- +title: Strapi v4 guide +sidebarTitle: Strapi +description: Learn how to use Meilisearch with Strapi v4. +--- + +This tutorial will show you how to integrate Meilisearch with [Strapi](https://strapi.io/) to create a search-based web app. First, you will use Strapi’s quick start guide to create a restaurant collection, and then search this collection with Meilisearch. + +## Prerequisites + +- [Node.js](https://nodejs.org/): active LTS or maintenance LTS versions, currently Node.js >=18.0.0 \<=20.x.x +- npm >=6.0.0 (installed with Node.js) +- A running instance of Meilisearch (v >= 1.x). If you need help with this part, you can consult the [Installation section](/learn/self_hosted/getting_started_with_self_hosted_meilisearch). + +## Create a back end using Strapi + +### Set up the project + +Create a directory called `my-app` where you will add the back and front-end parts of the application. Generate a back-end API using Strapi inside `my-app`: + +```bash +npx create-strapi-app@latest back --quickstart +``` + +This command creates a Strapi app in a new directory called `back` and opens the admin dashboard. Create an account to access it. + + + Strapi sign up form + + +Once you have created your account, you should be redirected to Strapi's admin dashboard. This is where you will configure your back-end API. + +### Build and manage your content + +The next step is to create a new collection type. A collection is like a blueprint of your content—in this case, it will be a collection of restaurants. You will create another collection called "Category" to organize your restaurants later. + + + Strapi dashboard with side menu 'Content-Type Builder' option circled + + +To follow along, complete "Part B: Build your data structure with the Content-type Builder" and steps 2 to 5 in "Part D: Add content to your Strapi Cloud project with the Content Manager" from Strapi's quick start guide. These will include: + +- creating collection types +- creating new entries +- setting roles & permissions +- publishing the content + +### Expand your database + +After finishing those steps of Strapi's quick start guide, two new collections named Restaurant and Category should have appeared under `Content Manager > Collection Types`. If you click on `Restaurant`, you can see that there is only one. Add more by clicking the `+ Create new entry` button in the upper-right corner of the dashboard. + + + Strapi dashboard: Content manager side menu, arrow indicating the location of the Restaurant Collection Type + + +Add the following three restaurants, one by one. For each restaurant, you need to press `Save` and then `Publish`. + +- Name: `The Butter Biscotte` +- Description: `All about butter, nothing about health.` + +Next, add the `French food` category on the bottom right corner of the page. + + + Strapi dashboard: create an entry form, arrow indicating the location of the categorie's location in the right side menu + + +- Name: `The Slimy Snail` +- Description: `Gastronomy is made of garlic and butter.` +- Category: `French food` + +- Name: `The Smell of Blue` +- Description: `Blue Cheese is not expired, it is how you eat it. With a bit of butter and a lot of happiness.` +- Category: `French food` + +Your Strapi back-end is now up and running. Strapi automatically creates a REST API for your Restaurants collection. Check Strapi's documentation for all available [API endpoints](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/content-api.html#api-endpoints). + +Now, it’s time to connect Strapi and Meilisearch and start searching. + +## Connect Strapi and Meilisearch + +To add the Meilisearch plugin to Strapi, you need to first quit the Strapi app. Go to the terminal window running Strapi and push `Ctrl+C` to kill the process. + +Next, install the plugin in the `back` directory. + +```bash +npm install strapi-plugin-meilisearch +``` + +After the installation, you have to rebuild the Strapi app before starting it again in development mode, since it makes configuration easier. + +```bash +npm run build +npm run develop +``` + +At this point, your Strapi app should be running once again on the default address: http://localhost:1337/admin. Open it in your browser. You should see an admin log-in page. Enter the credentials you used to create your account. + +Once connected, you should see the new `meilisearch` plugin on the left side of the screen. + + + Strapi dashboard with plugins side menu: arrow pointing at the 'meilisearch' option + + +Add your Meilisearch credentials on the Settings tab of the `meilisearch` plugin page. + + + Strapi dashboard with Meilisearch plugin selected: arrow pointing to the location of the settings tab + + +Now it's time to add your Strapi collection to Meilisearch. In the `Collections` tab on the `meilisearch` plugin page, you should see the `restaurant` and `category` content-types. + +By clicking on the checkbox next to `restaurant`, the content-type is automatically indexed in Meilisearch. + + + GIF showing the mouse clicking on 'restaurant' in the Meilisearch collections tab + + +The word “Hooked” appears when you click on the `restaurant`'s checkbox in the `Collections` tab. This means that each time you add, update or delete an entry in your restaurant content-types, Meilisearch is automatically updated. + +Once the indexing finishes, your restaurants are in Meilisearch. Access the [search preview](/getting_started/overview) confirm everything is working correctly by searching for “butter”. + + + GIF showing the word 'butter' being typed in the search bar and search results appearing instantly + + +Your Strapi entries are sent to Meilisearch as is. You can modify the data before sending it to Meilisearch, for instance by removing a field. Check out all the customization options on the [strapi-plugin-meilisearch page](https://github.com/meilisearch/strapi-plugin-meilisearch/#-customization). + +## Next steps + +This tutorial showed you how to add your Strapi collections to Meilisearch. + +In most real-life scenarios, you'll typically build a custom search interface and fetch results using Meilisearch's API. To learn how to quickly build a front-end interface of your own, check out the [Front-end integration page](/getting_started/instant_meilisearch/javascript) guide. diff --git a/getting_started/frameworks/symfony.mdx b/getting_started/frameworks/symfony.mdx new file mode 100644 index 000000000..ff660badb --- /dev/null +++ b/getting_started/frameworks/symfony.mdx @@ -0,0 +1,213 @@ +--- +title: Symfony +sidebarTitle: Symfony +description: Integrate Meilisearch with Symfony using the official bundle. +--- + +The official [meilisearch-symfony](https://github.com/meilisearch/meilisearch-symfony) bundle provides seamless integration between Meilisearch and Symfony applications with Doctrine ORM support. + +## Prerequisites + +- PHP 7.4 or higher +- Symfony 5.4 or higher +- Doctrine ORM (optional, for automatic entity indexing) +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the bundle + +```bash +composer require meilisearch/search-bundle +``` + +## 2. Configure the bundle + +Create or update `config/packages/meilisearch.yaml`: + +```yaml +meilisearch: + url: '%env(MEILISEARCH_URL)%' + api_key: '%env(MEILISEARCH_API_KEY)%' +``` + +Add to your `.env` file: + +```bash +MEILISEARCH_URL=https://your-instance.meilisearch.io +MEILISEARCH_API_KEY=your_api_key +``` + + +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Configure an entity for indexing + +Add the `Searchable` attribute to your Doctrine entity: + +```php + $this->id, + 'title' => $this->title, + 'year' => $this->year, + 'genres' => $this->genres, + ]; + } +} +``` + +## 4. Index your data + +Import existing entities to Meilisearch: + +```bash +php bin/console meilisearch:import +``` + +New entities are automatically indexed when created or updated via Doctrine. + +## 5. Search + +Use the `SearchService` to search your indexed entities: + +```php +search( + Movie::class, + 'matrix' + ); + + return $this->render('search/results.html.twig', [ + 'movies' => $results, + ]); + } +} +``` + +## 6. Search with filters + +First, configure filterable attributes in `config/packages/meilisearch.yaml`: + +```yaml +meilisearch: + url: '%env(MEILISEARCH_URL)%' + api_key: '%env(MEILISEARCH_API_KEY)%' + indices: + - name: movies + class: App\Entity\Movie + settings: + filterableAttributes: ['genres', 'year'] + sortableAttributes: ['year'] +``` + +Update the index settings: + +```bash +php bin/console meilisearch:create +``` + +Then search with filters: + +```php +$results = $searchService->search( + Movie::class, + 'action', + [ + 'filter' => 'year > 2000', + 'sort' => ['year:desc'], + ] +); +``` + +## Available commands + +| Command | Description | +|---------|-------------| +| `meilisearch:import` | Import all entities to Meilisearch | +| `meilisearch:clear` | Clear all indexed data | +| `meilisearch:create` | Create indexes with configured settings | +| `meilisearch:delete` | Delete indexes | + +## Raw client access + +For advanced operations, access the Meilisearch client directly: + +```php +use Meilisearch\Client; + +class MyService +{ + public function __construct(private Client $client) {} + + public function customOperation(): void + { + $index = $this->client->index('movies'); + $stats = $index->getStats(); + } +} +``` + +## Next steps + + + + Configure ranking and relevancy + + + Add filters and facets + + + Add semantic search + + + Explore all search parameters + + + +## Resources + +- [meilisearch-symfony on GitHub](https://github.com/meilisearch/meilisearch-symfony) +- [Bundle documentation](https://github.com/meilisearch/meilisearch-symfony/wiki) diff --git a/getting_started/instant_meilisearch/docsearch.mdx b/getting_started/instant_meilisearch/docsearch.mdx new file mode 100644 index 000000000..926784a47 --- /dev/null +++ b/getting_started/instant_meilisearch/docsearch.mdx @@ -0,0 +1,218 @@ +--- +title: Integrate a relevant search bar to your documentation +sidebarTitle: Docsearch +description: Use Meilisearch to index content in a text-heavy website. Covers installing Meilisearch, configuring a text scraper, and creating a simple front end. +--- + +This tutorial will guide you through the steps of building a relevant and powerful search bar for your documentation 🚀 + +- [Run a Meilisearch instance](#run-a-meilisearch-instance) +- [Scrape your content](#scrape-your-content) + - [Configuration file](#configuration-file) + - [Run the scraper](#run-the-scraper) +- [Integrate the search bar](#integrate-the-search-bar) + - [For VuePress documentation sites](#for-vuepress-documentation-sites) + - [For all kinds of documentation](#for-all-kinds-of-documentation) +- [What's next?](#whats-next) + +## Run a Meilisearch instance + +First, create a new Meilisearch project on Meilisearch Cloud. You can also [install and run Meilisearch locally or in another cloud service](/learn/self_hosted/getting_started_with_self_hosted_meilisearch#setup-and-installation). + + +The host URL and the API key you will provide in the next steps correspond to the credentials of this Meilisearch instance. + + +## Scrape your content + +The Meilisearch team provides and maintains a [scraper tool](https://github.com/meilisearch/docs-scraper) to automatically read the content of your website and store it into an index in Meilisearch. + +### Configuration file + +The scraper tool needs a configuration file to know what content you want to scrape. This is done by providing selectors (for example, the `html` tag). + +Here is an example of a basic configuration file: + +```json +{ + "index_uid": "docs", + "start_urls": [ + "https://www.example.com/doc/" + ], + "sitemap_urls": [ + "https://www.example.com/sitemap.xml" + ], + "stop_urls": [], + "selectors": { + "lvl0": { + "selector": ".docs-lvl0", + "global": true, + "default_value": "Documentation" + }, + "lvl1": { + "selector": ".docs-lvl1", + "global": true, + "default_value": "Chapter" + }, + "lvl2": ".docs-content .docs-lvl2", + "lvl3": ".docs-content .docs-lvl3", + "lvl4": ".docs-content .docs-lvl4", + "lvl5": ".docs-content .docs-lvl5", + "lvl6": ".docs-content .docs-lvl6", + "text": ".docs-content p, .docs-content li" + } +} +``` + +The `index_uid` field is the index identifier in your Meilisearch instance in which your website content is stored. The scraping tool will create a new index if it does not exist. + +The `docs-content` class is the main container of the textual content in this example. Most of the time, this tag is a `
` or an `
` HTML element. + +`lvlX` selectors should use the standard title tags like `h1`, `h2`, `h3`, etc. You can also use static classes. Set a unique `id` or `name` attribute to these elements. + +All searchable `lvl` elements outside this main documentation container (for instance, in a sidebar) must be `global` selectors. They will be globally picked up and injected to every document built from your page. + +If you use VuePress for your documentation, you can check out the [configuration file](https://github.com/meilisearch/documentation/blob/main/docs-scraper.config.json) we use in production. +In our case, the main container is `theme-default-content` and the selector titles and subtitles are `h1`, `h2`... + + +More [optional fields are available](https://github.com/meilisearch/docs-scraper#all-the-config-file-settings) to fit your needs. + + +### Run the scraper + +You can run the scraper with Docker. With our local Meilisearch instance set up at [the first step](#run-a-meilisearch-instance), we run: + +```bash +docker run -t --rm \ + --network=host \ + -e MEILISEARCH_HOST_URL='MEILISEARCH_URL' \ + -e MEILISEARCH_API_KEY='MASTER_KEY' \ + -v :/docs-scraper/config.json \ + getmeili/docs-scraper:latest pipenv run ./docs_scraper config.json +``` + + +If you don't want to use Docker, here are [other ways to run the scraper](https://github.com/meilisearch/docs-scraper#installation-and-usage). + + +`` should be the **absolute** path of your configuration file defined at [the previous step](#configuration-file). + +The API key should have the permissions to add documents into your Meilisearch instance. In a production environment, we recommend providing the `Default Admin API Key` as it has enough permissions to perform such requests. +_More about [Meilisearch security](/learn/security/basic_security)._ + + +We recommend running the scraper at each new deployment of your documentation, [as we do for the Meilisearch's one](https://github.com/meilisearch/documentation/blob/main/.github/workflows/scraper.yml). + + +## Integrate the search bar + +If your documentation is not a VuePress application, you can directly go to [this section](#for-all-kinds-of-documentation). + +### For VuePress documentation sites + +If you use VuePress for your documentation, we provide a [Vuepress plugin](https://github.com/meilisearch/vuepress-plugin-meilisearch). This plugin is used in production in the Meilisearch documentation. + +In your VuePress project: + + + + +```bash +yarn add vuepress-plugin-meilisearch +``` + + + + + +```bash +npm install vuepress-plugin-meilisearch +``` + + + + +In your `config.js` file: + +```js +module.exports = { + plugins: [ + [ + "vuepress-plugin-meilisearch", + { + "hostUrl": "", + "apiKey": "", + "indexUid": "docs" + } + ], + ], +} +``` + +The `hostUrl` and the `apiKey` fields are the credentials of the Meilisearch instance. Following on from this tutorial, they are respectively `MEILISEARCH_URL` and `MASTER_KEY`. + +`indexUid` is the index identifier in your Meilisearch instance in which your website content is stored. It has been defined in the [config file](#configuration-file). + +These three fields are mandatory, but more [optional fields are available](https://github.com/meilisearch/vuepress-plugin-meilisearch#customization) to customize your search bar. + + +Since the configuration file is public, we strongly recommend providing a key that can only access [the search endpoint](/reference/api/search/search-with-post) , such as the `Default Search API Key`, in a production environment. +Read more about [Meilisearch security](/learn/security/basic_security). + + +### For all kinds of documentation + +If you don't use VuePress for your documentation, we provide a [front-end SDK](https://github.com/meilisearch/docs-searchbar.js) to integrate a powerful and relevant search bar to any documentation website. + +![Docxtemplater search bar updating results for "HTML"](/assets/images/tuto-searchbar-for-docs/docxtemplater-searchbar-demo.gif) +_[Docxtemplater](https://docxtemplater.com/) search bar demo_ + +```html + + + + + + + + + + + + +``` + + +Replace `{version}` in the CDN URLs above with the actual docs-searchbar.js version number, for example `2.0.5`. Check the [docs-searchbar.js releases page](https://github.com/meilisearch/docs-searchbar.js/releases) for the latest version. + + +The `hostUrl` and the `apiKey` fields are the credentials of the Meilisearch instance. Following on from this tutorial, they are respectively `MEILISEARCH_URL` and `MASTER_KEY`. + +`indexUid` is the index identifier in your Meilisearch instance in which your website content is stored. It has been defined in the [config file](#configuration-file). +`inputSelector` is the `id` attribute of the HTML search input tag. + + +We strongly recommend providing a `Default Search API Key` in a production environment, which is enough to perform search requests. + +Read more about [Meilisearch security](/learn/security/basic_security). + + +The default behavior of this library fits perfectly for a documentation search bar, but you might need [some customizations](https://github.com/meilisearch/docs-searchbar.js#customization). + + +For more concrete examples, you can check out this [basic HTML file](https://github.com/meilisearch/docs-searchbar.js/blob/main/playgrounds/html/index.html) or [this more advanced Vue file](https://github.com/meilisearch/vuepress-plugin-meilisearch/blob/main/MeiliSearchBox.vue). + + +## Next steps + +At this point, you should have a working search engine on your website, congrats! 🎉 +You can check [this tutorial](/learn/self_hosted/getting_started_with_self_hosted_meilisearch) if you now want to run Meilisearch in production! diff --git a/getting_started/instant_meilisearch/javascript.mdx b/getting_started/instant_meilisearch/javascript.mdx new file mode 100644 index 000000000..6c9486ed6 --- /dev/null +++ b/getting_started/instant_meilisearch/javascript.mdx @@ -0,0 +1,124 @@ +--- +title: Instant-meilisearch +sidebarTitle: JavaScript +description: Build search interfaces with instant-meilisearch and InstantSearch. +--- + +[instant-meilisearch](https://github.com/meilisearch/instant-meilisearch) is the easiest way to add a search interface to your front-end. It connects Meilisearch to [InstantSearch](https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/), an open-source library by Algolia that provides pre-built UI components for search. + +## Why instant-meilisearch? + +- **Pre-built components**: Search boxes, hit lists, facet filters, pagination, and more +- **Framework support**: Works with React, Vue, Angular, and vanilla JavaScript +- **Customizable**: Full control over styling and behavior +- **Search-as-you-type**: Real-time results as users type + +## Quick example + +Create an `index.html` file with the following code: + +```html + + + + + + + +
+ +
+
+ + + + + + +``` + +Open this file in your browser to see a working search interface. + +## Framework guides + + + + Build search UIs with React InstantSearch + + + Build search UIs with Vue InstantSearch + + + +## Available widgets + +InstantSearch provides many pre-built widgets: + +| Widget | Description | +|--------|-------------| +| `searchBox` | Text input for search queries | +| `hits` | Display search results | +| `infiniteHits` | Infinite scroll results | +| `pagination` | Page navigation | +| `refinementList` | Facet filter checkboxes | +| `menu` | Single-select facet filter | +| `rangeSlider` | Numeric range filter | +| `sortBy` | Sort results dropdown | +| `stats` | Search statistics | + +[See all InstantSearch widgets](https://www.algolia.com/doc/api-reference/widgets/js/) + +## Using your own data + +The example above uses a public demo instance. To use your own Meilisearch instance: + +```javascript +const { searchClient } = instantMeiliSearch( + process.env.MEILISEARCH_URL, // Your instance URL + process.env.MEILISEARCH_API_KEY // Your search API key +); +``` + + +**Set up your environment:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" +export MEILISEARCH_API_KEY="your_search_api_key" +``` +[Get a free Cloud instance](https://cloud.meilisearch.com) + + +## Resources + +- [instant-meilisearch on GitHub](https://github.com/meilisearch/instant-meilisearch) +- [InstantSearch documentation](https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/) +- [Live demo](https://codesandbox.io/p/sandbox/eager-dust-f98w2w) diff --git a/getting_started/instant_meilisearch/react.mdx b/getting_started/instant_meilisearch/react.mdx new file mode 100644 index 000000000..1cd5106a3 --- /dev/null +++ b/getting_started/instant_meilisearch/react.mdx @@ -0,0 +1,128 @@ +--- +title: React quick start +sidebarTitle: React +description: Integrate a search-as-you-type experience into your React app. +--- + +Integrate a search-as-you-type experience into your React app. + +## 1. Create a React application + +Create your React application using a [Vite](https://vitejs.dev/) template: + +```bash +npm create vite@latest my-app -- --template react +``` + +## 2. Install the library of search components + +Navigate to your React app and install `react-instantsearch`, `@meilisearch/instant-meilisearch`, and `instantsearch.css`. + +```bash +npm install react-instantsearch @meilisearch/instant-meilisearch instantsearch.css +``` + +- [React InstantSearch](https://github.com/algolia/instantsearch/): front-end tools to customize your search environment +- [instant-meilisearch](https://github.com/meilisearch/meilisearch-js-plugins/tree/main/packages/instant-meilisearch): Meilisearch client to connect with React InstantSearch +- [instantsearch.css](https://github.com/algolia/instantsearch/tree/master/packages/instantsearch.css) (optional): CSS library to add basic styles to the search components + +## 3. Initialize the search client + +Use the following URL and API key to connect to a Meilisearch instance containing data from Steam video games. + +```jsx +import React from 'react'; +import { instantMeiliSearch } from '@meilisearch/instant-meilisearch'; + +const { searchClient } = instantMeiliSearch( + 'https://ms-adf78ae33284-106.lon.meilisearch.io', + 'a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303' +); +``` + +## 4. Add the InstantSearch provider + +`` is the root provider component for the InstantSearch library. It takes two props: the `searchClient` and the [index name](/getting_started/glossary/indexes#index-uid). + +```jsx +import React from 'react'; +import { InstantSearch } from 'react-instantsearch'; +import { instantMeiliSearch } from '@meilisearch/instant-meilisearch'; + +const { searchClient } = instantMeiliSearch( + 'https://ms-adf78ae33284-106.lon.meilisearch.io', + 'a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303' +); + +const App = () => ( + + +); + +export default App +``` + +## 5. Add a search bar and list search results + +Add the `SearchBox` and `InfiniteHits` components inside the `InstantSearch` wrapper component. The Hits component accepts a custom Hit component via the `hitComponent` prop, which allows customizing how each search result is rendered. + +Import the CSS library to style the search components. + +```jsx +import React from 'react'; +import { InstantSearch, SearchBox, InfiniteHits } from 'react-instantsearch'; +import { instantMeiliSearch } from '@meilisearch/instant-meilisearch'; +import 'instantsearch.css/themes/satellite.css'; + +const { searchClient } = instantMeiliSearch( + 'https://ms-adf78ae33284-106.lon.meilisearch.io', + 'a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303' +); + +const App = () => ( + + + + +); + +const Hit = ({ hit }) => ( +
+ {hit.name} +

{hit.name}

+

${hit.description}

+
+); +export default App +``` + + +Use the following CSS classes to add custom styles to your components: +`.ais-InstantSearch`, `.ais-SearchBox`, `.ais-InfiniteHits-list`, `.ais-InfiniteHits-item` + + +## 6. Start the app and search as you type + +Start the app by running: + +```bash +npm run dev +``` + +Now open your browser and navigate to your React app URL (e.g. `localhost:3000`), and start searching. + + + React app search UI with a search bar at the top and search results for a few video games + + +Encountering issues? Check out the code in action in our [live demo](https://codesandbox.io/p/sandbox/eager-dust-f98w2w)! + +## Next steps + +Want to search through your own data? [Create a project](https://cloud.meilisearch.com) in the Meilisearch Dashboard. Check out our [getting started guide](/getting_started/overview) for step-by-step instructions. diff --git a/getting_started/instant_meilisearch/vue.mdx b/getting_started/instant_meilisearch/vue.mdx new file mode 100644 index 000000000..3ebb3f56f --- /dev/null +++ b/getting_started/instant_meilisearch/vue.mdx @@ -0,0 +1,135 @@ +--- +title: Vue quick start +sidebarTitle: Vue +description: Integrate a search-as-you-type experience into your Vue app. +--- + +## 1. Create a Vue application + +Run the `npm create` tool to install base dependencies and create your app folder structure. + +```bash +npm create vue@latest my-app +``` + +## 2. Install the library of search components + +Navigate to your Vue app and install `vue-instantsearch`, `@meilisearch/instant-meilisearch`, and `instantsearch.css`. + +```bash +npm install vue-instantsearch @meilisearch/instant-meilisearch instantsearch.css +``` + +- [Vue InstantSearch](https://github.com/algolia/instantsearch/): front-end tools to customize your search environment +- [instant-meilisearch](https://github.com/meilisearch/meilisearch-js-plugins/tree/main/packages/instant-meilisearch): Meilisearch client to connect with Vue InstantSearch +- [instantsearch.css](https://github.com/algolia/instantsearch/tree/master/packages/instantsearch.css) (optional): CSS library to add basic styles to the search components + +## 3. Add InstantSearch + +Include InstantSearch into `main.js` to include the Vue InstantSearch library. + +```js +import { createApp } from 'vue'; +import App from './App.vue'; +import InstantSearch from 'vue-instantsearch/vue3/es'; + +const app = createApp(App); +app.use(InstantSearch); +app.mount('#app'); +``` + +## 4. Initialize the search client + +Add the code below to the `App.vue` file. + +```js + + + +``` + +These URL and API key point to a public Meilisearch instance that contains data from Steam video games. + +The `ais-instant-search` widget is the mandatory wrapper that allows you to configure your search. It takes two props: the `search-client` and the [`index-name`](/getting_started/glossary/indexes#index-uid). + +## 5. Add a search bar and list search results + +Add the `ais-search-box` and `ais-hits` widgets inside the `ais-instant-search` wrapper widget. + +Import the CSS library to style the search components. + +``` + + + +``` + +Use the slot directive to customize how each search result is rendered. + + +Use the following CSS classes to add custom styles to your components: +`.ais-InstantSearch`, `.ais-SearchBox`, `.ais-InfiniteHits-list`, `.ais-InfiniteHits-item` + + +## 6.Start the app and search as you type + +Start the app by running: + +```bash +npm run dev +``` + +Now open your browser, navigate to your Vue app URL (e.g., `localhost:5173`), and start searching. + + + Vue app search UI with a search bar at the top and search results for a few video games + + +Encountering issues? Check out the code in action in our [live demo](https://codesandbox.io/p/sandbox/ms-vue3-is-forked-wsrkl8)! + +## Next steps + +Want to search through your own data? [Create a project](https://cloud.meilisearch.com) in the Meilisearch Dashboard. Check out our [getting started guide](/getting_started/overview) for step-by-step instructions. diff --git a/getting_started/integrations/firebase.mdx b/getting_started/integrations/firebase.mdx new file mode 100644 index 000000000..672184dbf --- /dev/null +++ b/getting_started/integrations/firebase.mdx @@ -0,0 +1,126 @@ +--- +title: Firebase +sidebarTitle: Firebase +description: Sync your Firestore documents to Meilisearch using the official Firebase extension. +--- + +The official [firestore-meilisearch](https://github.com/meilisearch/firestore-meilisearch) extension automatically synchronizes documents from a Cloud Firestore collection to a Meilisearch index, enabling full-text search on your Firestore data. + + +[Meilisearch Cloud](https://www.meilisearch.com/cloud?utm_campaign=oss&utm_source=docs&utm_medium=firebase) is the easiest way to get a Meilisearch instance for use with Firebase. + + +## Prerequisites + +- A Firebase project on the Blaze (pay-as-you-go) plan +- Cloud Firestore set up in your Firebase project +- A running Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) +- A Meilisearch API key with write permissions + +## Install the extension + +You can install the extension using the Firebase Console or the Firebase CLI. + + + +Visit the [Firebase Extensions Hub](https://extensions.dev/extensions/meilisearch/firestore-meilisearch) and click **Install**. + +Follow the prompts to select your Firebase project and configure the extension. + + +```bash +firebase ext:install meilisearch/firestore-meilisearch --project=YOUR_PROJECT_ID +``` + +Replace `YOUR_PROJECT_ID` with your Firebase project ID. + + + +## Configuration + +During installation, you'll configure the following parameters: + +| Parameter | Description | +|-----------|-------------| +| **Cloud Functions location** | Region where the extension's functions will be deployed | +| **Collection path** | The Firestore collection to sync (e.g., `products`, `articles`) | +| **Fields to index** | Comma-separated list of field names, or leave blank to index all fields | +| **Meilisearch index name** | The name of the Meilisearch index to sync data to | +| **Meilisearch host** | Your Meilisearch instance URL (must start with `http://` or `https://`) | +| **Meilisearch API key** | An API key with permission to manage indexes | + +## How it works + +Once installed, the extension deploys a Cloud Function called `indexingWorker` that: + +1. **Listens** for document creates, updates, and deletions in your specified collection +2. **Syncs** changes to your Meilisearch index in real-time +3. **Maps** Firestore document IDs to a `_firestore_id` field in Meilisearch + + +The extension only monitors the specified collection, not subcollections. Install additional instances to sync other collections. + + +## Data format + +### Document IDs + +Firestore document IDs are automatically mapped to a `_firestore_id` field in Meilisearch. Any field named `_firestore_id` in your source documents will be ignored. + +### Geolocation + +For geo search functionality, name your GeoPoint field `_geo` in Firestore. Meilisearch will automatically recognize it for [geo search queries](/learn/filtering_and_sorting/geosearch). + +```javascript +// Firestore document with geo data +{ + name: "Eiffel Tower", + _geo: new firebase.firestore.GeoPoint(48.8584, 2.2945) +} +``` + +## Import existing documents + +The extension only syncs documents created or modified after installation. To import existing documents, use the provided import script: + +```bash +npx @meilisearch/firestore-meilisearch-scripts import +``` + + +See the [import script documentation](https://github.com/meilisearch/firestore-meilisearch/blob/main/guides/IMPORT_EXISTING_DOCUMENTS.md) for detailed instructions. + + +## Search your data + +Once your data is synced, you can search it using any Meilisearch SDK or the REST API: + + + +```javascript +import { MeiliSearch } from 'meilisearch' + +const client = new MeiliSearch({ + host: process.env.MEILISEARCH_URL, + apiKey: process.env.MEILISEARCH_API_KEY +}) + +const results = await client.index('products').search('phone') +console.log(results.hits) +``` + + +```bash +curl "${MEILISEARCH_URL}/indexes/products/search" \ + -H "Authorization: Bearer ${MEILISEARCH_API_KEY}" \ + -H "Content-Type: application/json" \ + -d '{"q": "phone"}' +``` + + + +## Resources + +- [GitHub repository](https://github.com/meilisearch/firestore-meilisearch) +- [Firebase Extensions Hub](https://extensions.dev/extensions/meilisearch/firestore-meilisearch) +- [Meilisearch blog: Firebase + Meilisearch](https://www.meilisearch.com/blog/firebase-meilisearch) diff --git a/getting_started/integrations/gatsby.mdx b/getting_started/integrations/gatsby.mdx new file mode 100644 index 000000000..8b3231c73 --- /dev/null +++ b/getting_started/integrations/gatsby.mdx @@ -0,0 +1,223 @@ +--- +title: Gatsby +sidebarTitle: Gatsby +description: Index your Gatsby site content to Meilisearch using the official plugin. +--- + +The official [gatsby-plugin-meilisearch](https://github.com/meilisearch/gatsby-plugin-meilisearch) indexes your Gatsby content to Meilisearch at build time using GraphQL queries. + + +[Meilisearch Cloud](https://www.meilisearch.com/cloud?utm_campaign=oss&utm_source=docs&utm_medium=gatsby) is the easiest way to get a Meilisearch instance for your Gatsby site. + + +## Prerequisites + +- A Gatsby project (v4.3.x or later) +- Node.js >= 14.15.x +- A running Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## Installation + +Install the plugin using npm or yarn: + + + +```bash +npm install gatsby-plugin-meilisearch +``` + + +```bash +yarn add gatsby-plugin-meilisearch +``` + + + +## Configuration + +Add the plugin to your `gatsby-config.js` file: + +```javascript +module.exports = { + plugins: [ + { + resolve: 'gatsby-plugin-meilisearch', + options: { + host: process.env.MEILISEARCH_URL, + apiKey: process.env.MEILISEARCH_API_KEY, + indexes: [ + { + indexUid: 'pages', + query: ` + query { + allMdx { + nodes { + frontmatter { + title + description + } + slug + excerpt + } + } + } + `, + transformer: (data) => + data.allMdx.nodes.map((node, index) => ({ + id: index, + title: node.frontmatter.title, + description: node.frontmatter.description, + slug: node.slug, + excerpt: node.excerpt + })) + } + ] + } + } + ] +} +``` + +## Plugin options + +| Option | Required | Default | Description | +|--------|----------|---------|-------------| +| `host` | Yes | - | Your Meilisearch instance URL | +| `apiKey` | No | - | API key (required if instance is password-protected) | +| `indexes` | Yes | - | Array of index configurations | +| `skipIndexing` | No | `false` | Skip indexing during build | +| `batchSize` | No | `1000` | Number of documents per indexing batch | + +## Index configuration + +Each index object requires three properties: + +### indexUid + +The name of your Meilisearch index. If the index already exists, it will be deleted and recreated during each build. + +```javascript +indexUid: 'blog_posts' +``` + +### query + +A GraphQL query that fetches the data you want to index: + +```javascript +query: ` + query { + allMarkdownRemark { + nodes { + frontmatter { + title + date + tags + } + html + excerpt + } + } + } +` +``` + +### transformer + +A function that transforms the GraphQL response into an array of documents for Meilisearch. Each document **must have an `id` field**: + +```javascript +transformer: (data) => + data.allMarkdownRemark.nodes.map((node, index) => ({ + id: index, + title: node.frontmatter.title, + date: node.frontmatter.date, + tags: node.frontmatter.tags, + content: node.excerpt + })) +``` + + +The transformer must return a flat array of objects. Nested structures should be flattened, and each object must include a unique `id` field. + + +## Index settings + +You can configure Meilisearch index settings like searchable attributes and filters: + +```javascript +{ + resolve: 'gatsby-plugin-meilisearch', + options: { + host: process.env.MEILISEARCH_URL, + apiKey: process.env.MEILISEARCH_API_KEY, + indexes: [ + { + indexUid: 'blog', + query: `...`, + transformer: (data) => ..., + settings: { + searchableAttributes: ['title', 'content', 'tags'], + filterableAttributes: ['tags', 'date'], + sortableAttributes: ['date'] + } + } + ] + } +} +``` + +## Build and index + +Run `gatsby build` to trigger indexing: + +```bash +gatsby build +``` + +You'll see a success message confirming documents were indexed: + +``` +gatsby-plugin-meilisearch: 42 documents added to "blog" index +``` + +## Add search to your site + +Use [instant-meilisearch](/getting_started/instant_meilisearch/javascript) to add a search interface: + +```jsx +import React from 'react' +import { InstantSearch, SearchBox, Hits } from 'react-instantsearch' +import { instantMeiliSearch } from '@meilisearch/instant-meilisearch' + +const searchClient = instantMeiliSearch( + process.env.GATSBY_MEILISEARCH_URL, + process.env.GATSBY_MEILISEARCH_SEARCH_KEY +) + +const Search = () => ( + + + + +) + +const Hit = ({ hit }) => ( +
+

{hit.title}

+

{hit.excerpt}

+
+) + +export default Search +``` + + +Use a search-only API key (`GATSBY_MEILISEARCH_SEARCH_KEY`) for client-side search. Never expose your admin API key in the browser. + + +## Resources + +- [GitHub repository](https://github.com/meilisearch/gatsby-plugin-meilisearch) +- [Meilisearch blog: Add search to Gatsby](https://www.meilisearch.com/blog/add-a-search-bar-to-your-gatsby-project-using-meilisearch) +- [instant-meilisearch documentation](/getting_started/instant_meilisearch/javascript) diff --git a/getting_started/integrations/meilisearch_importer.mdx b/getting_started/integrations/meilisearch_importer.mdx new file mode 100644 index 000000000..aea53c6ea --- /dev/null +++ b/getting_started/integrations/meilisearch_importer.mdx @@ -0,0 +1,186 @@ +--- +title: Meilisearch Importer +sidebarTitle: Importer CLI +description: Efficiently import large CSV, NDJSON, or JSON datasets into Meilisearch using the official CLI tool. +--- + +The official [meilisearch-importer](https://github.com/meilisearch/meilisearch-importer) is a high-performance CLI tool for bulk importing large datasets into Meilisearch. It handles millions of documents with automatic retry logic and progress tracking. + +## Features + +- Import CSV, NDJSON, and JSON (array of objects) files +- Handle datasets from thousands to 40+ million documents +- Automatic retry logic for failed batches +- Real-time progress tracking with ETA +- Configurable batch sizes for performance tuning + +## Prerequisites + +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) +- One of: + - [Rust/Cargo](https://rustup.rs/) installed (for building from source) + - Pre-built binary from releases + +## Installation + + + +```bash +cargo install meilisearch-importer +``` + + +Download the latest release from [GitHub Releases](https://github.com/meilisearch/meilisearch-importer/releases) for your platform. + +```bash +# Example for Linux +wget https://github.com/meilisearch/meilisearch-importer/releases/latest/download/meilisearch-importer-linux-amd64 +chmod +x meilisearch-importer-linux-amd64 +mv meilisearch-importer-linux-amd64 /usr/local/bin/meilisearch-importer +``` + + + +## Basic usage + +Import a CSV file: + +```bash +meilisearch-importer \ + --url "${MEILISEARCH_URL}" \ + --api-key "${MEILISEARCH_API_KEY}" \ + --index movies \ + --file movies.csv +``` + + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" +export MEILISEARCH_API_KEY="your_api_key" +``` + + +## Supported formats + +### CSV + +```bash +meilisearch-importer --index products --file products.csv +``` + +CSV files must have a header row. The importer automatically detects column types. + +### NDJSON (Newline-delimited JSON) + +```bash +meilisearch-importer --index products --file products.ndjson +``` + +Each line must be a valid JSON object: + +```json +{"id": 1, "title": "Product A", "price": 29.99} +{"id": 2, "title": "Product B", "price": 39.99} +``` + +### JSON array + +```bash +meilisearch-importer --index products --file products.json +``` + +File must contain an array of objects: + +```json +[ + {"id": 1, "title": "Product A", "price": 29.99}, + {"id": 2, "title": "Product B", "price": 39.99} +] +``` + +## Configuration options + +| Option | Description | Default | +|--------|-------------|---------| +| `--url` | Meilisearch URL | `http://localhost:7700` | +| `--api-key` | Meilisearch API key | None | +| `--index` | Target index name | Required | +| `--file` | Input file path | Required | +| `--batch-size` | Documents per batch | `1000` | +| `--primary-key` | Primary key field | Auto-detected | + +## Performance tuning + +### Batch size + +Adjust batch size based on your document size and network: + +```bash +# Smaller documents: larger batches +meilisearch-importer --index logs --file logs.ndjson --batch-size 5000 + +# Larger documents: smaller batches +meilisearch-importer --index articles --file articles.json --batch-size 100 +``` + +### Primary key + +Specify the primary key if auto-detection fails: + +```bash +meilisearch-importer --index products --file products.csv --primary-key product_id +``` + +## Example: Import a large dataset + +Import 10 million products with progress tracking: + +```bash +meilisearch-importer \ + --url "https://ms-xxx.meilisearch.io" \ + --api-key "your_master_key" \ + --index products \ + --file products.ndjson \ + --batch-size 2000 +``` + +Output: + +``` +Importing products.ndjson to index 'products'... +[████████████████████░░░░░░░░░░░░░░░░░░░░] 52% (5.2M/10M) ETA: 12m 34s +``` + +## After import + +Verify your import: + +```bash +curl "${MEILISEARCH_URL}/indexes/products/stats" \ + -H "Authorization: Bearer ${MEILISEARCH_API_KEY}" +``` + +Test a search: + +```bash +curl "${MEILISEARCH_URL}/indexes/products/search" \ + -H "Authorization: Bearer ${MEILISEARCH_API_KEY}" \ + -d '{"q": "test"}' +``` + +## Next steps + + + + Set up searchable and filterable attributes + + + Identify and fix indexing bottlenecks + + + +## Resources + +- [meilisearch-importer on GitHub](https://github.com/meilisearch/meilisearch-importer) +- [Releases](https://github.com/meilisearch/meilisearch-importer/releases) diff --git a/getting_started/integrations/meilisync.mdx b/getting_started/integrations/meilisync.mdx new file mode 100644 index 000000000..4d44ef697 --- /dev/null +++ b/getting_started/integrations/meilisync.mdx @@ -0,0 +1,283 @@ +--- +title: Meilisync +sidebarTitle: Meilisync +description: Real-time sync from MySQL, PostgreSQL, or MongoDB to Meilisearch. +--- + +[Meilisync](https://github.com/long2ice/meilisync) is a community tool that enables real-time synchronization from MySQL, PostgreSQL, or MongoDB to Meilisearch. Changes in your database are automatically reflected in your search index. + + +Meilisync is a community-maintained project, not officially supported by Meilisearch. For bugs or questions, open an issue on the [meilisync GitHub issues page](https://github.com/long2ice/meilisync/issues). + + +## Features + +- Real-time sync using database change streams (CDC) +- Support for MySQL, PostgreSQL, and MongoDB +- Multiple sync tasks for different tables/collections +- Progress tracking via file or Redis +- Plugin system for data transformation + +## Prerequisites + +- Python 3.9 or higher +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) +- A supported database with change data capture enabled + +### Database requirements + + + +Enable binary logging with row format: + +```ini +# my.cnf +[mysqld] +server-id = 1 +log_bin = mysql-bin +binlog_format = ROW +binlog_row_image = FULL +``` + + +Enable logical replication: + +```ini +# postgresql.conf +wal_level = logical +max_replication_slots = 10 +max_wal_senders = 10 +``` + +Install the wal2json extension: + +```bash +# Debian/Ubuntu +sudo apt install postgresql-14-wal2json +``` + + +Enable replica set mode: + +```yaml +# mongod.conf +replication: + replSetName: "rs0" +``` + +Initialize the replica set: + +```javascript +rs.initiate() +``` + + + +## Installation + + + +```bash +pip install meilisync +``` + +Install database-specific drivers: + +```bash +# For MySQL +pip install meilisync[mysql] + +# For PostgreSQL +pip install meilisync[postgres] + +# For MongoDB +pip install meilisync[mongo] +``` + + +```bash +docker pull long2ice/meilisync +``` + + + +## Configuration + +Create a `config.yml` file: + +```yaml +meilisearch: + api_url: https://your-instance.meilisearch.io + api_key: your_master_key + +progress: + type: file # or 'redis' + +source: + type: mysql # or 'postgres', 'mongo' + host: localhost + port: 3306 + user: root + password: password + database: myapp + +sync: + - table: products + index: products + primary_key: id + fields: + - id + - name + - description + - price + - category + + - table: articles + index: articles + primary_key: id +``` + +## Running meilisync + +Start the sync process: + +```bash +meilisync start -c config.yml +``` + + + +```bash +docker run -d \ + -v $(pwd)/config.yml:/app/config.yml \ + long2ice/meilisync \ + meilisync start -c /app/config.yml +``` + + +```yaml +version: '3.8' +services: + meilisync: + image: long2ice/meilisync + volumes: + - ./config.yml:/app/config.yml + command: meilisync start -c /app/config.yml + depends_on: + - mysql + - meilisearch +``` + + + +## Full sync + +Import all existing data before starting real-time sync: + +```bash +meilisync refresh -c config.yml +``` + +This performs a full table scan and indexes all documents. + +## Verify sync + +Check the sync is working: + +```bash +# Check Meilisearch index stats +curl "${MEILISEARCH_URL}/indexes/products/stats" \ + -H "Authorization: Bearer ${MEILISEARCH_API_KEY}" +``` + +Insert a test record in your database and verify it appears in Meilisearch within seconds. + +## Configuration options + +### Source configuration + + + +```yaml +source: + type: mysql + host: localhost + port: 3306 + user: root + password: password + database: myapp + server_id: 1 # Unique server ID for replication +``` + + +```yaml +source: + type: postgres + host: localhost + port: 5432 + user: postgres + password: password + database: myapp + slot_name: meilisync_slot # Replication slot name +``` + + +```yaml +source: + type: mongo + host: localhost + port: 27017 + database: myapp + # Optional authentication + user: root + password: password +``` + + + +### Progress storage + +Track sync progress to resume after restarts: + +```yaml +# File-based (default) +progress: + type: file + path: ./progress.json + +# Redis-based (for distributed setups) +progress: + type: redis + url: redis://localhost:6379/0 +``` + +### Field mapping + +Select specific fields and rename them: + +```yaml +sync: + - table: products + index: products + fields: + id: product_id # Rename 'id' to 'product_id' in Meilisearch + name: ~ # Keep original name + price: ~ +``` + +## Next steps + + + + Set up searchable and filterable attributes + + + Configure ranking and relevancy + + + +## Resources + +- [Meilisync on GitHub](https://github.com/long2ice/meilisync) +- [Meilisync documentation](https://github.com/long2ice/meilisync#readme) +- [Meilisync Admin Dashboard](https://github.com/long2ice/meilisync-admin) diff --git a/getting_started/integrations/postman.mdx b/getting_started/integrations/postman.mdx new file mode 100644 index 000000000..e3aed17f4 --- /dev/null +++ b/getting_started/integrations/postman.mdx @@ -0,0 +1,51 @@ +--- +title: Postman collection for Meilisearch +sidebarTitle: Postman +description: This how-to guide explains how to use Postman when testing and debugging Meilisearch's API. +--- + +Are you tired of using the `curl` command in your terminal to test Meilisearch? It can be tedious to re-write every route when wanting to try out an API. + +Postman is a platform that lets you create HTTP requests you can easily reuse and share with everyone. We provide a [Postman collection](https://github.com/meilisearch/meilisearch-postman) containing all the routes of the Meilisearch API! 🚀 + +If you don't have Postman already, you can [download it here](https://www.postman.com/downloads/). It's free and available on many OS distributions. + +## Import the collection + +Once you have downloaded the [Postman collection](https://github.com/meilisearch/meilisearch-postman), you need to import it into Postman. + + + The 'Import' button + + +## Edit the configuration + + + Selecting 'Edit' from the overflow menu + + +Set the "Token" if needed (set to `masterKey` by default): + + + The 'Token' field set to masterKey and 'Type' to Bearer Token in the 'Authorization' tab. + + +Set `url` (set to Meilisearch's local port by default) and `indexUID` (set to `indexUID` by default): + + + Setting the 'URL' to http://localhost:7700/ and 'indexUID' to indexUId in the Variables tab. + + +The `url` and `indexUID` variables are used in all the collection routes, like in this one: + + + Highlighting {{url}} and {{indexUID}} + + +## Start to use it + +You can now [run your Meilisearch instance](/learn/self_hosted/getting_started_with_self_hosted_meilisearch#setup-and-installation) and create your first index: + + + The 'Send' button + diff --git a/getting_started/integrations/vercel.mdx b/getting_started/integrations/vercel.mdx new file mode 100644 index 000000000..068f86af4 --- /dev/null +++ b/getting_started/integrations/vercel.mdx @@ -0,0 +1,115 @@ +--- +title: Integrate Meilisearch Cloud with Vercel +sidebarTitle: Vercel +description: Link Meilisearch Cloud to a Vercel Project. +--- + +In this guide you will learn how to link a [Meilisearch Cloud](https://www.meilisearch.com/cloud?utm_campaign=oss&utm_source=docs&utm_medium=vercel-integration) instance to your Vercel project. + +## Introducing our tools + +### What is Vercel? + +[Vercel](https://vercel.com/) is a cloud platform for building and deploying web applications. It works out of the box with most popular web development tools. + +### What is Meilisearch Cloud? + +[Meilisearch Cloud](https://www.meilisearch.com/cloud?utm_campaign=oss&utm_source=docs&utm_medium=vercel-integration) offers a managed search service that is scalable, reliable, and designed to meet the needs of all companies. + +## Integrate Meilisearch into your Vercel project + +### Create and deploy a Vercel project + +From your Vercel dashboard, create a new project. You can create a project from a template, or import a Git repository. + + + Create a new project on Vercel dashboard + + +Select your project, then click on **Deploy**. Once deployment is complete, go back to your project’s dashboard. + +### Add the Meilisearch integration + +Go to the project settings tab and click on **Integrations** on the sidebar menu to the left of your screen. + + + Selecting the integration tab in the project settings + + +Search for the [Meilisearch integration](https://vercel.com/integrations/meilisearch-cloud) in the search bar. Click on the **Add integration** button. + + + Meilisearch integration page in Vercel's marketplace + + +Select the Vercel account or team and the project you to which you want to add the integration. You may add the Meilisearch integration to one or more projects in this menu. + + + Form to add Meilisearch integration, the 'Specific projects' option is selected + + +Click on **Continue**. Vercel will display a list with the permissions the integration needs to work properly. Review it, then click on **Add Integration**. + +### Set up Meilisearch Cloud + +Vercel will redirect you to the Meilisearch Cloud page. Log in or create an account. New accounts enjoy a 14-day free trial period. + +You can choose an existing project or create a new one. To create a new project, complete the form with the project name and region. + + + Meilisearch Cloud form to create a project complete, with 'search-app' as the project's name and 'Frankfurt' as the region + + +Once you click on **Create project**, you should see the following message: “Your Meilisearch + Vercel integration is one click away from being completed.” Click "Finish the Vercel integration setup". Meilisearch will then redirect you back to the Vercel integration page. + + + Meilisearch integration page in Vercel's dashboard + + +### Understand and use Meilisearch API keys + +Meilisearch creates [four default API keys](/learn/security/basic_security#obtaining-api-keys): `Default Search API Key`, `Default Admin API Key`, `Default Read-Only Admin API Key`, and `Default Chat API Key`. + +#### Admin API key + +Use the `Default Admin API Key`, to control who can access or create new documents, indexes, and change index settings. Be careful with the admin key and avoid exposing it in public environments. + +#### Search API key + +Use the `Default Search API Key` to access the [search route](/reference/api/search/search-with-post). This is the one you want to use in your front end. + +The Search and Admin API keys are automatically added to Vercel along with the Meilisearch URL. For more information on the other default keys, consult the [security documentation](/learn/security/basic_security#obtaining-api-keys). + + +The master key–which hasn’t been added to Vercel–grants users full control over an instance. You can find it in your project’s overview on your [Meilisearch Cloud dashboard](https://cloud.meilisearch.com/projects/?utm_campaign=oss&utm_source=docs&utm_medium=vercel-integration). Read more about [Meilisearch security](/learn/security/differences_master_api_keys). + + +### Review your project settings + +Go back to your project settings and check the new Meilisearch environment variables: + +- `MEILISEARCH_ADMIN_KEY` +- `MEILISEARCH_URL` +- `MEILISEARCH_SEARCH_KEY` + + + Display the environment variables in the project settings + + + +When using [Next.js](https://nextjs.org/), ensure you prefix your browser-facing environment variables with `NEXT_PUBLIC_`. This makes them available to the browser side of your application. Be aware that any variable with this prefix is embedded in the client-side JavaScript bundle and visible to end users. Only use `NEXT_PUBLIC_` with the search API key, never with the admin or master key. + + +## Take advantage of the Meilisearch Cloud dashboard + + + Meilisearch Cloud dashboard: overview of the 'search-app' project + + +Use the [Meilisearch Cloud dashboard](https://cloud.meilisearch.com/projects/?utm_campaign=oss&utm_source=docs&utm_medium=vercel-integration), to index documents and manage your project settings. + +## Resources and next steps + +Check out the [quick start guide](/learn/self_hosted/getting_started_with_self_hosted_meilisearch#add-documents) for a short introduction on how to use Meilisearch. We also provide many [SDKs and tools](/learn/resources/sdks), so you can use Meilisearch in your favorite language or framework. + +You are now ready to [start searching](/reference/api/search/search-with-post)! diff --git a/getting_started/overview.mdx b/getting_started/overview.mdx new file mode 100644 index 000000000..7fa43b87c --- /dev/null +++ b/getting_started/overview.mdx @@ -0,0 +1,57 @@ +--- +title: Welcome to Meilisearch +sidebarTitle: Overview +description: Meilisearch is a lightning-fast search engine that fits effortlessly into your apps, websites, and workflow. +--- + +Meilisearch is a **RESTful search API** that delivers fast, relevant search results in under 50 milliseconds. Whether you're building an e-commerce site, a documentation portal, or a SaaS application, Meilisearch provides a ready-to-go search solution. + + + + Get started in minutes with Meilisearch Cloud + + + Deploy on your own infrastructure + + + +## Why Meilisearch? + + + + Search results in under 50ms, even with millions of documents + + + Returns relevant results even when queries contain mistakes + + + Simple REST API with SDKs for every major language + + + Fine-tune ranking, filtering, and relevancy to your needs + + + +## See it in action + +[![Search bar updating results](/assets/images/movies-demo-dark.gif)](https://where2watch.meilisearch.com/?utm_campaign=oss&utm_source=docs&utm_medium=overview) + +Try our live demos: +- [E-commerce search](https://ecommerce.meilisearch.com/) - Browse millions of products +- [Where to Watch](https://where2watch.meilisearch.com/) - Search the TMDB movie database +- [SaaS search](https://saas.meilisearch.com/) - Multi-model search with Laravel + +## Get started with Meilisearch Cloud + +[Meilisearch Cloud](https://www.meilisearch.com/cloud?utm_campaign=oss&utm_source=docs&utm_medium=overview) gets you up and running in minutes with automatic scaling, updates, and maintenance. Start with a [14-day free trial](https://cloud.meilisearch.com). + +## Next steps + + + + Discover all Meilisearch capabilities + + + Get started with your preferred language + + diff --git a/getting_started/sdks/dart.mdx b/getting_started/sdks/dart.mdx new file mode 100644 index 000000000..f9adbed63 --- /dev/null +++ b/getting_started/sdks/dart.mdx @@ -0,0 +1,190 @@ +--- +title: Dart quick start +sidebarTitle: Dart +description: Get started with Meilisearch using the Dart SDK in 5 minutes. +--- + +This guide walks you through setting up Meilisearch with Dart and Flutter. + +## Prerequisites + +- Dart 3.0 or higher (or Flutter 3.0+) +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the SDK + +Add the dependency to your `pubspec.yaml`: + +```yaml +dependencies: + meilisearch: ^0.17.1 +``` + +Then run: + +```bash +dart pub get +# or for Flutter +flutter pub get +``` + +## 2. Connect to Meilisearch + +```dart +import 'package:meilisearch/meilisearch.dart'; +import 'dart:io'; + +final client = MeiliSearchClient( + Platform.environment['MEILISEARCH_URL']!, + Platform.environment['MEILISEARCH_API_KEY'], +); +``` + + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" # or http://localhost:7700 +export MEILISEARCH_API_KEY="your_api_key" +``` +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Add documents + +```dart +// Add documents +final movies = [ + {'id': 1, 'title': 'The Matrix', 'genres': ['Action', 'Sci-Fi'], 'year': 1999}, + {'id': 2, 'title': 'Inception', 'genres': ['Action', 'Thriller'], 'year': 2010}, + {'id': 3, 'title': 'Interstellar', 'genres': ['Drama', 'Sci-Fi'], 'year': 2014}, +]; + +final index = client.index('movies'); +final task = await index.addDocuments(movies); + +// Wait for indexing to complete +await client.waitForTask(task.taskUid); +``` + +## 4. Search + +```dart +final result = await index.search('matrix'); + +for (final hit in result.hits) { + print('${hit['title']} (${hit['year']})'); +} +// The Matrix (1999) +``` + +## 5. Search with filters + +First, configure filterable attributes: + +```dart +await index.updateFilterableAttributes(['genres', 'year']); +``` + +Then search with filters: + +```dart +final result = await index.search( + '', + SearchQuery(filter: 'genres = "Sci-Fi" AND year > 2000'), +); +``` + +## Full example + +```dart +import 'package:meilisearch/meilisearch.dart'; +import 'dart:io'; + +void main() async { + // Connect + final client = MeiliSearchClient( + Platform.environment['MEILISEARCH_URL']!, + Platform.environment['MEILISEARCH_API_KEY'], + ); + + // Add documents + final movies = [ + {'id': 1, 'title': 'The Matrix', 'year': 1999}, + {'id': 2, 'title': 'Inception', 'year': 2010}, + {'id': 3, 'title': 'Interstellar', 'year': 2014}, + ]; + + final index = client.index('movies'); + final task = await index.addDocuments(movies); + await client.waitForTask(task.taskUid); + + // Search + final result = await index.search('inter'); + for (final hit in result.hits) { + print(hit['title']); + } +} +``` + +## Flutter example + +```dart +import 'package:flutter/material.dart'; +import 'package:meilisearch/meilisearch.dart'; + +class SearchScreen extends StatefulWidget { + @override + _SearchScreenState createState() => _SearchScreenState(); +} + +class _SearchScreenState extends State { + final client = MeiliSearchClient('YOUR_MEILISEARCH_URL', 'YOUR_SEARCH_KEY'); + List> results = []; + + Future search(String query) async { + final result = await client.index('movies').search(query); + setState(() { + results = List>.from(result.hits); + }); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + TextField(onChanged: search), + Expanded( + child: ListView.builder( + itemCount: results.length, + itemBuilder: (context, index) => ListTile( + title: Text(results[index]['title']), + ), + ), + ), + ], + ); + } +} +``` + +## Next steps + + + + Configure ranking and relevancy + + + Add filters and facets + + + Add semantic search + + + Explore all search parameters + + + +## Resources + +- [meilisearch-dart on GitHub](https://github.com/meilisearch/meilisearch-dart) +- [Package on pub.dev](https://pub.dev/packages/meilisearch) diff --git a/getting_started/sdks/dotnet.mdx b/getting_started/sdks/dotnet.mdx new file mode 100644 index 000000000..87096a44e --- /dev/null +++ b/getting_started/sdks/dotnet.mdx @@ -0,0 +1,155 @@ +--- +title: .NET quick start +sidebarTitle: .NET +description: Get started with Meilisearch using the .NET SDK in 5 minutes. +--- + +This guide walks you through setting up Meilisearch with .NET (C#). + +## Prerequisites + +- .NET 6.0 or higher +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the SDK + + + +```bash +dotnet add package MeiliSearch +``` + + +```bash +Install-Package MeiliSearch +``` + + + +## 2. Connect to Meilisearch + +```csharp +using Meilisearch; + +var client = new MeilisearchClient( + Environment.GetEnvironmentVariable("MEILISEARCH_URL"), + Environment.GetEnvironmentVariable("MEILISEARCH_API_KEY") +); +``` + + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" # or http://localhost:7700 +export MEILISEARCH_API_KEY="your_api_key" +``` +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Add documents + +```csharp +// Define your document class +public class Movie +{ + public int Id { get; set; } + public string Title { get; set; } + public string[] Genres { get; set; } + public int Year { get; set; } +} + +// Add documents +var movies = new Movie[] +{ + new Movie { Id = 1, Title = "The Matrix", Genres = new[] { "Action", "Sci-Fi" }, Year = 1999 }, + new Movie { Id = 2, Title = "Inception", Genres = new[] { "Action", "Thriller" }, Year = 2010 }, + new Movie { Id = 3, Title = "Interstellar", Genres = new[] { "Drama", "Sci-Fi" }, Year = 2014 } +}; + +var index = client.Index("movies"); +var task = await index.AddDocumentsAsync(movies); + +// Wait for indexing to complete +await client.WaitForTaskAsync(task.TaskUid); +``` + +## 4. Search + +```csharp +var results = await index.SearchAsync("matrix"); + +foreach (var hit in results.Hits) +{ + Console.WriteLine($"{hit.Title} ({hit.Year})"); +} +// The Matrix (1999) +``` + +## 5. Search with filters + +First, configure filterable attributes: + +```csharp +await index.UpdateFilterableAttributesAsync(new[] { "genres", "year" }); +``` + +Then search with filters: + +```csharp +var results = await index.SearchAsync("", new SearchQuery +{ + Filter = "genres = \"Sci-Fi\" AND year > 2000" +}); +``` + +## Full example + +```csharp +using Meilisearch; + +var client = new MeilisearchClient( + Environment.GetEnvironmentVariable("MEILISEARCH_URL"), + Environment.GetEnvironmentVariable("MEILISEARCH_API_KEY") +); + +// Add documents +var movies = new[] +{ + new { Id = 1, Title = "The Matrix", Year = 1999 }, + new { Id = 2, Title = "Inception", Year = 2010 }, + new { Id = 3, Title = "Interstellar", Year = 2014 } +}; + +var index = client.Index("movies"); +var task = await index.AddDocumentsAsync(movies); +await client.WaitForTaskAsync(task.TaskUid); + +// Search +var results = await index.SearchAsync("inter"); +foreach (var hit in results.Hits) +{ + Console.WriteLine(hit); +} +``` + +## Next steps + + + + Configure ranking and relevancy + + + Add filters and facets + + + Add semantic search + + + Explore all search parameters + + + +## Resources + +- [meilisearch-dotnet on GitHub](https://github.com/meilisearch/meilisearch-dotnet) +- [SDK documentation](https://github.com/meilisearch/meilisearch-dotnet#readme) diff --git a/getting_started/sdks/go.mdx b/getting_started/sdks/go.mdx new file mode 100644 index 000000000..aa22683d7 --- /dev/null +++ b/getting_started/sdks/go.mdx @@ -0,0 +1,155 @@ +--- +title: Go quick start +sidebarTitle: Go +description: Get started with Meilisearch using the Go SDK in 5 minutes. +--- + +This guide walks you through setting up Meilisearch with Go. + +## Prerequisites + +- Go 1.16 or higher +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the SDK + +```bash +go get github.com/meilisearch/meilisearch-go +``` + +## 2. Connect to Meilisearch + +```go +package main + +import ( + "os" + "github.com/meilisearch/meilisearch-go" +) + +func main() { + client := meilisearch.New( + os.Getenv("MEILISEARCH_URL"), + meilisearch.WithAPIKey(os.Getenv("MEILISEARCH_API_KEY")), + ) +} +``` + + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" # or http://localhost:7700 +export MEILISEARCH_API_KEY="your_api_key" +``` +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Add documents + +```go +type Movie struct { + ID int `json:"id"` + Title string `json:"title"` + Genres []string `json:"genres"` + Year int `json:"year"` +} + +movies := []Movie{ + {ID: 1, Title: "The Matrix", Genres: []string{"Action", "Sci-Fi"}, Year: 1999}, + {ID: 2, Title: "Inception", Genres: []string{"Action", "Thriller"}, Year: 2010}, + {ID: 3, Title: "Interstellar", Genres: []string{"Drama", "Sci-Fi"}, Year: 2014}, +} + +// Add documents to the 'movies' index +task, _ := client.Index("movies").AddDocuments(movies) + +// Wait for indexing to complete +client.WaitForTask(task.TaskUID) +``` + +## 4. Search + +```go +results, _ := client.Index("movies").Search("matrix", nil) + +fmt.Println(results.Hits) +// [map[id:1 title:The Matrix genres:[Action Sci-Fi] year:1999]] +``` + +## 5. Search with filters + +First, configure filterable attributes: + +```go +client.Index("movies").UpdateFilterableAttributes(&[]string{"genres", "year"}) +``` + +Then search with filters: + +```go +results, _ := client.Index("movies").Search("", &meilisearch.SearchRequest{ + Filter: "genres = 'Sci-Fi' AND year > 2000", +}) +``` + +## Full example + +```go +package main + +import ( + "fmt" + "os" + "github.com/meilisearch/meilisearch-go" +) + +type Movie struct { + ID int `json:"id"` + Title string `json:"title"` + Genres []string `json:"genres"` + Year int `json:"year"` +} + +func main() { + client := meilisearch.New( + os.Getenv("MEILISEARCH_URL"), + meilisearch.WithAPIKey(os.Getenv("MEILISEARCH_API_KEY")), + ) + + // Add documents + movies := []Movie{ + {ID: 1, Title: "The Matrix", Genres: []string{"Action", "Sci-Fi"}, Year: 1999}, + {ID: 2, Title: "Inception", Genres: []string{"Action", "Thriller"}, Year: 2010}, + {ID: 3, Title: "Interstellar", Genres: []string{"Drama", "Sci-Fi"}, Year: 2014}, + } + + task, _ := client.Index("movies").AddDocuments(movies) + client.WaitForTask(task.TaskUID) + + // Search + results, _ := client.Index("movies").Search("inter", nil) + fmt.Println(results.Hits) +} +``` + +## Next steps + + + + Configure ranking and relevancy + + + Add filters and facets + + + Add semantic search + + + Explore all search parameters + + + +## Resources + +- [meilisearch-go on GitHub](https://github.com/meilisearch/meilisearch-go) +- [SDK documentation](https://pkg.go.dev/github.com/meilisearch/meilisearch-go) diff --git a/getting_started/sdks/java.mdx b/getting_started/sdks/java.mdx new file mode 100644 index 000000000..f394d9095 --- /dev/null +++ b/getting_started/sdks/java.mdx @@ -0,0 +1,176 @@ +--- +title: Java quick start +sidebarTitle: Java +description: Get started with Meilisearch using the Java SDK in 5 minutes. +--- + +This guide walks you through setting up Meilisearch with Java. + +## Prerequisites + +- Java 17 or higher +- Maven or Gradle +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the SDK + + + +```xml + + com.meilisearch.sdk + meilisearch-java + 0.17.1 + +``` + + +```groovy +implementation 'com.meilisearch.sdk:meilisearch-java:0.17.1' +``` + + + +## 2. Connect to Meilisearch + +```java +import com.meilisearch.sdk.Client; +import com.meilisearch.sdk.Config; + +public class Main { + public static void main(String[] args) { + Client client = new Client(new Config( + System.getenv("MEILISEARCH_URL"), + System.getenv("MEILISEARCH_API_KEY") + )); + } +} +``` + + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" # or http://localhost:7700 +export MEILISEARCH_API_KEY="your_api_key" +``` +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Add documents + +```java +import com.meilisearch.sdk.Index; +import com.meilisearch.sdk.model.TaskInfo; + +// Define your document class +class Movie { + public int id; + public String title; + public String[] genres; + public int year; + + public Movie(int id, String title, String[] genres, int year) { + this.id = id; + this.title = title; + this.genres = genres; + this.year = year; + } +} + +// Add documents +Movie[] movies = { + new Movie(1, "The Matrix", new String[]{"Action", "Sci-Fi"}, 1999), + new Movie(2, "Inception", new String[]{"Action", "Thriller"}, 2010), + new Movie(3, "Interstellar", new String[]{"Drama", "Sci-Fi"}, 2014) +}; + +Index index = client.index("movies"); +TaskInfo task = index.addDocuments(new Gson().toJson(movies)); + +// Wait for indexing to complete +client.waitForTask(task.getTaskUid()); +``` + +## 4. Search + +```java +import com.meilisearch.sdk.SearchRequest; +import com.meilisearch.sdk.model.SearchResult; + +SearchResult results = index.search("matrix"); + +System.out.println(results.getHits()); +// [{id=1, title=The Matrix, genres=[Action, Sci-Fi], year=1999}] +``` + +## 5. Search with filters + +First, configure filterable attributes: + +```java +index.updateFilterableAttributesSettings(new String[]{"genres", "year"}); +``` + +Then search with filters: + +```java +SearchRequest searchRequest = new SearchRequest("matrix") + .setFilter(new String[]{"genres = \"Sci-Fi\"", "year > 2000"}); + +SearchResult results = index.search(searchRequest); +``` + +## Full example + +```java +import com.meilisearch.sdk.*; +import com.meilisearch.sdk.model.*; +import com.google.gson.Gson; + +public class Main { + public static void main(String[] args) throws Exception { + // Connect + Client client = new Client(new Config( + System.getenv("MEILISEARCH_URL"), + System.getenv("MEILISEARCH_API_KEY") + )); + + // Add documents + String documents = "[" + + "{\"id\": 1, \"title\": \"The Matrix\", \"year\": 1999}," + + "{\"id\": 2, \"title\": \"Inception\", \"year\": 2010}," + + "{\"id\": 3, \"title\": \"Interstellar\", \"year\": 2014}" + + "]"; + + Index index = client.index("movies"); + TaskInfo task = index.addDocuments(documents); + client.waitForTask(task.getTaskUid()); + + // Search + SearchResult results = index.search("inter"); + System.out.println(results.getHits()); + } +} +``` + +## Next steps + + + + Configure ranking and relevancy + + + Add filters and facets + + + Add semantic search + + + Explore all search parameters + + + +## Resources + +- [meilisearch-java on GitHub](https://github.com/meilisearch/meilisearch-java) +- [SDK documentation](https://github.com/meilisearch/meilisearch-java#readme) diff --git a/getting_started/sdks/javascript.mdx b/getting_started/sdks/javascript.mdx new file mode 100644 index 000000000..a44043232 --- /dev/null +++ b/getting_started/sdks/javascript.mdx @@ -0,0 +1,133 @@ +--- +title: JavaScript quick start +sidebarTitle: JavaScript +description: Get started with Meilisearch using the JavaScript SDK in 5 minutes. +--- + +This guide walks you through setting up Meilisearch with JavaScript/Node.js. + +## Prerequisites + +- Node.js 14 or higher +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the SDK + +```bash +npm install meilisearch +# or +yarn add meilisearch +``` + +## 2. Connect to Meilisearch + +```javascript +import { MeiliSearch } from 'meilisearch' + +const client = new MeiliSearch({ + host: process.env.MEILISEARCH_URL, + apiKey: process.env.MEILISEARCH_API_KEY +}) +``` + + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" # or http://localhost:7700 +export MEILISEARCH_API_KEY="your_api_key" +``` +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Add documents + +```javascript +const movies = [ + { id: 1, title: 'The Matrix', genres: ['Action', 'Sci-Fi'], year: 1999 }, + { id: 2, title: 'Inception', genres: ['Action', 'Thriller'], year: 2010 }, + { id: 3, title: 'Interstellar', genres: ['Drama', 'Sci-Fi'], year: 2014 } +] + +// Add documents to the 'movies' index +const task = await client.index('movies').addDocuments(movies) + +// Wait for indexing to complete +await client.waitForTask(task.taskUid) +``` + +## 4. Search + +```javascript +const results = await client.index('movies').search('matrix') + +console.log(results.hits) +// [{ id: 1, title: 'The Matrix', genres: ['Action', 'Sci-Fi'], year: 1999 }] +``` + +## 5. Search with filters + +First, configure filterable attributes: + +```javascript +await client.index('movies').updateFilterableAttributes(['genres', 'year']) +``` + +Then search with filters: + +```javascript +const results = await client.index('movies').search('', { + filter: 'genres = "Sci-Fi" AND year > 2000' +}) +``` + +## Full example + +```javascript +import { MeiliSearch } from 'meilisearch' + +const client = new MeiliSearch({ + host: process.env.MEILISEARCH_URL, + apiKey: process.env.MEILISEARCH_API_KEY +}) + +async function main() { + // Add documents + const movies = [ + { id: 1, title: 'The Matrix', genres: ['Action', 'Sci-Fi'], year: 1999 }, + { id: 2, title: 'Inception', genres: ['Action', 'Thriller'], year: 2010 }, + { id: 3, title: 'Interstellar', genres: ['Drama', 'Sci-Fi'], year: 2014 } + ] + + const task = await client.index('movies').addDocuments(movies) + await client.waitForTask(task.taskUid) + + // Search + const results = await client.index('movies').search('inter') + console.log(results.hits) +} + +main() +``` + +## Next steps + + + + Add search to your React, Vue, or Angular app + + + Configure ranking and relevancy + + + Add filters and facets + + + Explore all search parameters + + + +## Resources + +- [meilisearch-js on GitHub](https://github.com/meilisearch/meilisearch-js) +- [SDK documentation](https://github.com/meilisearch/meilisearch-js#readme) +- [instant-meilisearch](https://github.com/meilisearch/meilisearch-js-plugins/tree/main/packages/instant-meilisearch) - InstantSearch adapter diff --git a/getting_started/sdks/php.mdx b/getting_started/sdks/php.mdx new file mode 100644 index 000000000..b2cdef248 --- /dev/null +++ b/getting_started/sdks/php.mdx @@ -0,0 +1,154 @@ +--- +title: PHP quick start +sidebarTitle: PHP +description: Get started with Meilisearch using the PHP SDK in 5 minutes. +--- + +This guide walks you through setting up Meilisearch with PHP. + +## Prerequisites + +- PHP 7.4 or higher +- Composer +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the SDK + +```bash +composer require meilisearch/meilisearch-php +``` + +## 2. Connect to Meilisearch + +```php + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" # or http://localhost:7700 +export MEILISEARCH_API_KEY="your_api_key" +``` +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Add documents + +```php +$movies = [ + ['id' => 1, 'title' => 'The Matrix', 'genres' => ['Action', 'Sci-Fi'], 'year' => 1999], + ['id' => 2, 'title' => 'Inception', 'genres' => ['Action', 'Thriller'], 'year' => 2010], + ['id' => 3, 'title' => 'Interstellar', 'genres' => ['Drama', 'Sci-Fi'], 'year' => 2014] +]; + +// Add documents to the 'movies' index +$task = $client->index('movies')->addDocuments($movies); + +// Wait for indexing to complete +$client->waitForTask($task['taskUid']); +``` + +## 4. Search + +```php +$results = $client->index('movies')->search('matrix'); + +print_r($results->getHits()); +// [['id' => 1, 'title' => 'The Matrix', 'genres' => ['Action', 'Sci-Fi'], 'year' => 1999]] +``` + +## 5. Search with filters + +First, configure filterable attributes: + +```php +$client->index('movies')->updateFilterableAttributes(['genres', 'year']); +``` + +Then search with filters: + +```php +$results = $client->index('movies')->search('', [ + 'filter' => 'genres = "Sci-Fi" AND year > 2000' +]); +``` + +## Full example + +```php + 1, 'title' => 'The Matrix', 'genres' => ['Action', 'Sci-Fi'], 'year' => 1999], + ['id' => 2, 'title' => 'Inception', 'genres' => ['Action', 'Thriller'], 'year' => 2010], + ['id' => 3, 'title' => 'Interstellar', 'genres' => ['Drama', 'Sci-Fi'], 'year' => 2014] +]; + +$task = $client->index('movies')->addDocuments($movies); +$client->waitForTask($task['taskUid']); + +// Search +$results = $client->index('movies')->search('inter'); +print_r($results->getHits()); +``` + +## Laravel integration + +For Laravel applications, use Laravel Scout with the Meilisearch driver: + +```bash +composer require laravel/scout +php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider" +``` + +Configure in your `.env`: + +```env +SCOUT_DRIVER=meilisearch +MEILISEARCH_HOST=https://your-instance.meilisearch.io +MEILISEARCH_KEY=your_api_key +``` + +[See the full Laravel Scout guide →](/getting_started/frameworks/laravel) + +## Next steps + + + + Full Laravel integration guide + + + Configure ranking and relevancy + + + Add filters and facets + + + Explore all search parameters + + + +## Resources + +- [meilisearch-php on GitHub](https://github.com/meilisearch/meilisearch-php) +- [SDK documentation](https://github.com/meilisearch/meilisearch-php#readme) diff --git a/getting_started/sdks/python.mdx b/getting_started/sdks/python.mdx new file mode 100644 index 000000000..4310b87f4 --- /dev/null +++ b/getting_started/sdks/python.mdx @@ -0,0 +1,128 @@ +--- +title: Python quick start +sidebarTitle: Python +description: Get started with Meilisearch using the Python SDK in 5 minutes. +--- + +This guide walks you through setting up Meilisearch with Python. + +## Prerequisites + +- Python 3.8 or higher +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the SDK + +```bash +pip install meilisearch +``` + +## 2. Connect to Meilisearch + +```python +import meilisearch +import os + +client = meilisearch.Client( + os.environ.get('MEILISEARCH_URL'), + os.environ.get('MEILISEARCH_API_KEY') +) +``` + + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" # or http://localhost:7700 +export MEILISEARCH_API_KEY="your_api_key" +``` +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Add documents + +```python +movies = [ + {'id': 1, 'title': 'The Matrix', 'genres': ['Action', 'Sci-Fi'], 'year': 1999}, + {'id': 2, 'title': 'Inception', 'genres': ['Action', 'Thriller'], 'year': 2010}, + {'id': 3, 'title': 'Interstellar', 'genres': ['Drama', 'Sci-Fi'], 'year': 2014} +] + +# Add documents to the 'movies' index +task = client.index('movies').add_documents(movies) + +# Wait for indexing to complete +client.wait_for_task(task.task_uid) +``` + +## 4. Search + +```python +results = client.index('movies').search('matrix') + +print(results['hits']) +# [{'id': 1, 'title': 'The Matrix', 'genres': ['Action', 'Sci-Fi'], 'year': 1999}] +``` + +## 5. Search with filters + +First, configure filterable attributes: + +```python +client.index('movies').update_filterable_attributes(['genres', 'year']) +``` + +Then search with filters: + +```python +results = client.index('movies').search('', { + 'filter': 'genres = "Sci-Fi" AND year > 2000' +}) +``` + +## Full example + +```python +import meilisearch +import os + +client = meilisearch.Client( + os.environ.get('MEILISEARCH_URL'), + os.environ.get('MEILISEARCH_API_KEY') +) + +# Add documents +movies = [ + {'id': 1, 'title': 'The Matrix', 'genres': ['Action', 'Sci-Fi'], 'year': 1999}, + {'id': 2, 'title': 'Inception', 'genres': ['Action', 'Thriller'], 'year': 2010}, + {'id': 3, 'title': 'Interstellar', 'genres': ['Drama', 'Sci-Fi'], 'year': 2014} +] + +task = client.index('movies').add_documents(movies) +client.wait_for_task(task.task_uid) + +# Search +results = client.index('movies').search('inter') +print(results['hits']) +``` + +## Next steps + + + + Configure ranking and relevancy + + + Add filters and facets + + + Add semantic search + + + Explore all search parameters + + + +## Resources + +- [meilisearch-python on GitHub](https://github.com/meilisearch/meilisearch-python) +- [SDK documentation](https://github.com/meilisearch/meilisearch-python#readme) diff --git a/getting_started/sdks/ruby.mdx b/getting_started/sdks/ruby.mdx new file mode 100644 index 000000000..4888fa681 --- /dev/null +++ b/getting_started/sdks/ruby.mdx @@ -0,0 +1,156 @@ +--- +title: Ruby quick start +sidebarTitle: Ruby +description: Get started with Meilisearch using the Ruby SDK in 5 minutes. +--- + +This guide walks you through setting up Meilisearch with Ruby. + +## Prerequisites + +- Ruby 2.7 or higher +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the SDK + +```bash +gem install meilisearch +``` + +Or add to your Gemfile: + +```ruby +gem 'meilisearch' +``` + +## 2. Connect to Meilisearch + +```ruby +require 'meilisearch' + +client = MeiliSearch::Client.new( + ENV['MEILISEARCH_URL'], + ENV['MEILISEARCH_API_KEY'] +) +``` + + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" # or http://localhost:7700 +export MEILISEARCH_API_KEY="your_api_key" +``` +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Add documents + +```ruby +movies = [ + { id: 1, title: 'The Matrix', genres: ['Action', 'Sci-Fi'], year: 1999 }, + { id: 2, title: 'Inception', genres: ['Action', 'Thriller'], year: 2010 }, + { id: 3, title: 'Interstellar', genres: ['Drama', 'Sci-Fi'], year: 2014 } +] + +# Add documents to the 'movies' index +task = client.index('movies').add_documents(movies) + +# Wait for indexing to complete +client.wait_for_task(task['taskUid']) +``` + +## 4. Search + +```ruby +results = client.index('movies').search('matrix') + +puts results['hits'] +# [{"id"=>1, "title"=>"The Matrix", "genres"=>["Action", "Sci-Fi"], "year"=>1999}] +``` + +## 5. Search with filters + +First, configure filterable attributes: + +```ruby +client.index('movies').update_filterable_attributes(['genres', 'year']) +``` + +Then search with filters: + +```ruby +results = client.index('movies').search('', { + filter: 'genres = "Sci-Fi" AND year > 2000' +}) +``` + +## Full example + +```ruby +require 'meilisearch' + +client = MeiliSearch::Client.new( + ENV['MEILISEARCH_URL'], + ENV['MEILISEARCH_API_KEY'] +) + +# Add documents +movies = [ + { id: 1, title: 'The Matrix', genres: ['Action', 'Sci-Fi'], year: 1999 }, + { id: 2, title: 'Inception', genres: ['Action', 'Thriller'], year: 2010 }, + { id: 3, title: 'Interstellar', genres: ['Drama', 'Sci-Fi'], year: 2014 } +] + +task = client.index('movies').add_documents(movies) +client.wait_for_task(task['taskUid']) + +# Search +results = client.index('movies').search('inter') +puts results['hits'] +``` + +## Rails integration + +For Rails applications, use the meilisearch-rails gem: + +```bash +gem install meilisearch-rails +``` + +Add to your model: + +```ruby +class Movie < ApplicationRecord + include MeiliSearch::Rails + + meilisearch do + attribute :title, :genres, :year + searchable_attributes [:title] + filterable_attributes [:genres, :year] + end +end +``` + +[See the full Rails guide →](/getting_started/frameworks/rails) + +## Next steps + + + + Full Rails integration guide + + + Configure ranking and relevancy + + + Add filters and facets + + + Explore all search parameters + + + +## Resources + +- [meilisearch-ruby on GitHub](https://github.com/meilisearch/meilisearch-ruby) +- [meilisearch-rails on GitHub](https://github.com/meilisearch/meilisearch-rails) diff --git a/getting_started/sdks/rust.mdx b/getting_started/sdks/rust.mdx new file mode 100644 index 000000000..9efa84f9c --- /dev/null +++ b/getting_started/sdks/rust.mdx @@ -0,0 +1,178 @@ +--- +title: Rust quick start +sidebarTitle: Rust +description: Get started with Meilisearch using the Rust SDK in 5 minutes. +--- + +This guide walks you through setting up Meilisearch with Rust. + +## Prerequisites + +- Rust stable (1.65+) +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the SDK + +Add to your `Cargo.toml`: + +```toml +[dependencies] +meilisearch-sdk = "0.27" +tokio = { version = "1", features = ["full"] } +serde = { version = "1", features = ["derive"] } +``` + +## 2. Connect to Meilisearch + +```rust +use meilisearch_sdk::client::Client; +use std::env; + +#[tokio::main] +async fn main() { + let client = Client::new( + env::var("MEILISEARCH_URL").unwrap(), + Some(env::var("MEILISEARCH_API_KEY").unwrap()) + ).unwrap(); +} +``` + + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" # or http://localhost:7700 +export MEILISEARCH_API_KEY="your_api_key" +``` +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Add documents + +```rust +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize, Debug)] +struct Movie { + id: i32, + title: String, + genres: Vec, + year: i32, +} + +let movies = vec![ + Movie { id: 1, title: "The Matrix".to_string(), genres: vec!["Action".to_string(), "Sci-Fi".to_string()], year: 1999 }, + Movie { id: 2, title: "Inception".to_string(), genres: vec!["Action".to_string(), "Thriller".to_string()], year: 2010 }, + Movie { id: 3, title: "Interstellar".to_string(), genres: vec!["Drama".to_string(), "Sci-Fi".to_string()], year: 2014 }, +]; + +// Add documents to the 'movies' index +let task = client.index("movies").add_documents(&movies, Some("id")).await.unwrap(); + +// Wait for indexing to complete +task.wait_for_completion(&client, None, None).await.unwrap(); +``` + +## 4. Search + +```rust +let results: SearchResults = client + .index("movies") + .search() + .with_query("matrix") + .execute() + .await + .unwrap(); + +println!("{:?}", results.hits); +``` + +## 5. Search with filters + +First, configure filterable attributes: + +```rust +client.index("movies") + .set_filterable_attributes(&["genres", "year"]) + .await + .unwrap(); +``` + +Then search with filters: + +```rust +let results: SearchResults = client + .index("movies") + .search() + .with_filter(r#"genres = "Sci-Fi" AND year > 2000"#) + .execute() + .await + .unwrap(); +``` + +## Full example + +```rust +use meilisearch_sdk::client::Client; +use meilisearch_sdk::search::SearchResults; +use serde::{Deserialize, Serialize}; +use std::env; + +#[derive(Serialize, Deserialize, Debug)] +struct Movie { + id: i32, + title: String, + genres: Vec, + year: i32, +} + +#[tokio::main] +async fn main() { + let client = Client::new( + env::var("MEILISEARCH_URL").unwrap(), + Some(env::var("MEILISEARCH_API_KEY").unwrap()) + ).unwrap(); + + // Add documents + let movies = vec![ + Movie { id: 1, title: "The Matrix".to_string(), genres: vec!["Action".to_string(), "Sci-Fi".to_string()], year: 1999 }, + Movie { id: 2, title: "Inception".to_string(), genres: vec!["Action".to_string(), "Thriller".to_string()], year: 2010 }, + Movie { id: 3, title: "Interstellar".to_string(), genres: vec!["Drama".to_string(), "Sci-Fi".to_string()], year: 2014 }, + ]; + + let task = client.index("movies").add_documents(&movies, Some("id")).await.unwrap(); + task.wait_for_completion(&client, None, None).await.unwrap(); + + // Search + let results: SearchResults = client + .index("movies") + .search() + .with_query("inter") + .execute() + .await + .unwrap(); + + println!("{:?}", results.hits); +} +``` + +## Next steps + + + + Configure ranking and relevancy + + + Add filters and facets + + + Add semantic search + + + Explore all search parameters + + + +## Resources + +- [meilisearch-rust on GitHub](https://github.com/meilisearch/meilisearch-rust) +- [SDK documentation](https://docs.rs/meilisearch-sdk) diff --git a/getting_started/sdks/swift.mdx b/getting_started/sdks/swift.mdx new file mode 100644 index 000000000..9a2a15d29 --- /dev/null +++ b/getting_started/sdks/swift.mdx @@ -0,0 +1,172 @@ +--- +title: Swift quick start +sidebarTitle: Swift +description: Get started with Meilisearch using the Swift SDK in 5 minutes. +--- + +This guide walks you through setting up Meilisearch with Swift for iOS, macOS, and server-side Swift applications. + +## Prerequisites + +- Swift 5.5 or higher +- Xcode 13+ (for iOS/macOS development) +- A Meilisearch instance ([Cloud](https://cloud.meilisearch.com) or [self-hosted](/learn/self_hosted/getting_started_with_self_hosted_meilisearch)) + +## 1. Install the SDK + + + +Add the dependency to your `Package.swift`: + +```swift +dependencies: [ + .package(url: "https://github.com/meilisearch/meilisearch-swift.git", from: "0.17.0") +] +``` + +Or in Xcode: File → Add Packages → Enter the repository URL. + + +Add to your `Podfile`: + +```ruby +pod 'MeiliSearch' +``` + +Then run `pod install`. + + + +## 2. Connect to Meilisearch + +```swift +import MeiliSearch + +let client = try! MeiliSearch( + host: ProcessInfo.processInfo.environment["MEILISEARCH_URL"]!, + apiKey: ProcessInfo.processInfo.environment["MEILISEARCH_API_KEY"] +) +``` + + +**Set your environment variables:** +```bash +export MEILISEARCH_URL="https://your-instance.meilisearch.io" # or http://localhost:7700 +export MEILISEARCH_API_KEY="your_api_key" +``` +[Get a free Cloud instance →](https://cloud.meilisearch.com) + + +## 3. Add documents + +```swift +// Define your document struct +struct Movie: Codable, Equatable { + let id: Int + let title: String + let genres: [String] + let year: Int +} + +// Add documents +let movies = [ + Movie(id: 1, title: "The Matrix", genres: ["Action", "Sci-Fi"], year: 1999), + Movie(id: 2, title: "Inception", genres: ["Action", "Thriller"], year: 2010), + Movie(id: 3, title: "Interstellar", genres: ["Drama", "Sci-Fi"], year: 2014) +] + +let index = client.index("movies") + +// Using async/await +let task = try await index.addDocuments(documents: movies) +try await client.waitForTask(taskUid: task.taskUid) +``` + +## 4. Search + +```swift +let searchResult: Searchable = try await index.search("matrix") + +for hit in searchResult.hits { + print("\(hit.title) (\(hit.year))") +} +// The Matrix (1999) +``` + +## 5. Search with filters + +First, configure filterable attributes: + +```swift +try await index.updateFilterableAttributes(["genres", "year"]) +``` + +Then search with filters: + +```swift +let searchParams = SearchParameters( + query: "", + filter: "genres = \"Sci-Fi\" AND year > 2000" +) + +let results: Searchable = try await index.search(searchParams) +``` + +## Full example + +```swift +import MeiliSearch + +// Connect +let client = try! MeiliSearch( + host: ProcessInfo.processInfo.environment["MEILISEARCH_URL"]!, + apiKey: ProcessInfo.processInfo.environment["MEILISEARCH_API_KEY"] +) + +struct Movie: Codable, Equatable { + let id: Int + let title: String + let year: Int +} + +Task { + // Add documents + let movies = [ + Movie(id: 1, title: "The Matrix", year: 1999), + Movie(id: 2, title: "Inception", year: 2010), + Movie(id: 3, title: "Interstellar", year: 2014) + ] + + let index = client.index("movies") + let task = try await index.addDocuments(documents: movies) + try await client.waitForTask(taskUid: task.taskUid) + + // Search + let results: Searchable = try await index.search("inter") + for hit in results.hits { + print(hit.title) + } +} +``` + +## Next steps + + + + Configure ranking and relevancy + + + Add filters and facets + + + Add semantic search + + + Explore all search parameters + + + +## Resources + +- [meilisearch-swift on GitHub](https://github.com/meilisearch/meilisearch-swift) +- [SDK documentation](https://github.com/meilisearch/meilisearch-swift#readme) From 6ac564a08db49e08d87ab1a282b89e5aff5babfa Mon Sep 17 00:00:00 2001 From: Quentin de Quelen Date: Wed, 11 Mar 2026 00:22:35 +0100 Subject: [PATCH 2/4] Remove duplicate guide pages now covered by Getting Started section Entire-Checkpoint: 9c68757644a6 --- docs.json | 54 ++++--- guides/front_end/react_quick_start.mdx | 127 ---------------- guides/front_end/vue_quick_start.mdx | 134 ----------------- guides/laravel_scout.mdx | 192 ------------------------- guides/ruby_on_rails_quick_start.mdx | 125 ---------------- guides/strapi_v4.mdx | 131 ----------------- guides/vercel.mdx | 114 --------------- 7 files changed, 31 insertions(+), 846 deletions(-) delete mode 100644 guides/front_end/react_quick_start.mdx delete mode 100644 guides/front_end/vue_quick_start.mdx delete mode 100644 guides/laravel_scout.mdx delete mode 100644 guides/ruby_on_rails_quick_start.mdx delete mode 100644 guides/strapi_v4.mdx delete mode 100644 guides/vercel.mdx diff --git a/docs.json b/docs.json index 728a4bfad..d280bc602 100644 --- a/docs.json +++ b/docs.json @@ -813,19 +813,9 @@ "group": "Front end", "pages": [ "guides/front_end/front_end_integration", - "guides/front_end/react_quick_start", - "guides/front_end/vue_quick_start", "guides/front_end/pagination" ] }, - { - "group": "Back end", - "pages": [ - "guides/laravel_scout", - "guides/strapi_v4", - "guides/ruby_on_rails_quick_start" - ] - }, { "group": "Artificial intelligence", "pages": [ @@ -870,12 +860,6 @@ "guides/running_production" ] }, - { - "group": "Integrations", - "pages": [ - "guides/vercel" - ] - }, { "group": "Miscellaneous", "pages": [ @@ -1110,7 +1094,7 @@ }, { "source": "/learn/cookbooks/laravel_scout", - "destination": "/guides/back_end/laravel_scout" + "destination": "/getting_started/frameworks/laravel" }, { "source": "/learn/cookbooks/large_documents", @@ -1146,11 +1130,11 @@ }, { "source": "/learn/cookbooks/strapi_v4", - "destination": "/guides/back_end/strapi_v4" + "destination": "/getting_started/frameworks/strapi" }, { "source": "/learn/cookbooks/vercel", - "destination": "/guides/integrations/vercel" + "destination": "/getting_started/integrations/vercel" }, { "source": "/learn/core_concepts/documents", @@ -1238,7 +1222,7 @@ }, { "source": "/learn/front_end/react_instantsearch", - "destination": "/guides/front_end/react_quick_start" + "destination": "/getting_started/instant_meilisearch/react" }, { "source": "/learn/getting_started/a", @@ -1730,7 +1714,7 @@ }, { "source": "/guides/back_end/laravel_scout", - "destination": "/guides/laravel_scout" + "destination": "/getting_started/frameworks/laravel" }, { "source": "/guides/database/meilisync_mysql", @@ -1746,7 +1730,7 @@ }, { "source": "/guides/front_end/react_instantsearch", - "destination": "/guides/front_end/react_quick_start" + "destination": "/getting_started/instant_meilisearch/react" }, { "source": "/guides/front_end/search_bar_for_docs", @@ -1754,7 +1738,7 @@ }, { "source": "/guides/integrations/vercel", - "destination": "/guides/vercel" + "destination": "/getting_started/integrations/vercel" }, { "source": "/guides/performance/indexing_best_practices", @@ -1899,6 +1883,30 @@ { "source": "/reference/api/tokenize", "destination": "/reference/api/authorization" + }, + { + "source": "/guides/laravel_scout", + "destination": "/getting_started/frameworks/laravel" + }, + { + "source": "/guides/strapi_v4", + "destination": "/getting_started/frameworks/strapi" + }, + { + "source": "/guides/ruby_on_rails_quick_start", + "destination": "/getting_started/frameworks/rails" + }, + { + "source": "/guides/front_end/react_quick_start", + "destination": "/getting_started/instant_meilisearch/react" + }, + { + "source": "/guides/front_end/vue_quick_start", + "destination": "/getting_started/instant_meilisearch/vue" + }, + { + "source": "/guides/vercel", + "destination": "/getting_started/integrations/vercel" } ] } diff --git a/guides/front_end/react_quick_start.mdx b/guides/front_end/react_quick_start.mdx deleted file mode 100644 index 7f8e0253f..000000000 --- a/guides/front_end/react_quick_start.mdx +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: React quick start -description: Integrate a search-as-you-type experience into your React app. ---- - -Integrate a search-as-you-type experience into your React app. - -## 1. Create a React application - -Create your React application using a [Vite](https://vitejs.dev/) template: - -```bash -npm create vite@latest my-app -- --template react -``` - -## 2. Install the library of search components - -Navigate to your React app and install `react-instantsearch`, `@meilisearch/instant-meilisearch`, and `instantsearch.css`. - -```bash -npm install react-instantsearch @meilisearch/instant-meilisearch instantsearch.css -``` - -- [React InstantSearch](https://github.com/algolia/instantsearch/): front-end tools to customize your search environment -- [instant-meilisearch](https://github.com/meilisearch/meilisearch-js-plugins/tree/main/packages/instant-meilisearch): Meilisearch client to connect with React InstantSearch -- [instantsearch.css](https://github.com/algolia/instantsearch/tree/master/packages/instantsearch.css) (optional): CSS library to add basic styles to the search components - -## 3. Initialize the search client - -Use the following URL and API key to connect to a Meilisearch instance containing data from Steam video games. - -```jsx -import React from 'react'; -import { instantMeiliSearch } from '@meilisearch/instant-meilisearch'; - -const { searchClient } = instantMeiliSearch( - 'https://ms-adf78ae33284-106.lon.meilisearch.io', - 'a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303' -); -``` - -## 4. Add the InstantSearch provider - -`` is the root provider component for the InstantSearch library. It takes two props: the `searchClient` and the [index name](/learn/getting_started/indexes#index-uid). - -```jsx -import React from 'react'; -import { InstantSearch } from 'react-instantsearch'; -import { instantMeiliSearch } from '@meilisearch/instant-meilisearch'; - -const { searchClient } = instantMeiliSearch( - 'https://ms-adf78ae33284-106.lon.meilisearch.io', - 'a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303' -); - -const App = () => ( - - -); - -export default App -``` - -## 5. Add a search bar and list search results - -Add the `SearchBox` and `InfiniteHits` components inside the `InstantSearch` wrapper component. The Hits component accepts a custom Hit component via the `hitComponent` prop, which allows customizing how each search result is rendered. - -Import the CSS library to style the search components. - -```jsx -import React from 'react'; -import { InstantSearch, SearchBox, InfiniteHits } from 'react-instantsearch'; -import { instantMeiliSearch } from '@meilisearch/instant-meilisearch'; -import 'instantsearch.css/themes/satellite.css'; - -const { searchClient } = instantMeiliSearch( - 'https://ms-adf78ae33284-106.lon.meilisearch.io', - 'a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303' -); - -const App = () => ( - - - - -); - -const Hit = ({ hit }) => ( -
- {hit.name} -

{hit.name}

-

${hit.description}

-
-); -export default App -``` - - -Use the following CSS classes to add custom styles to your components: -`.ais-InstantSearch`, `.ais-SearchBox`, `.ais-InfiniteHits-list`, `.ais-InfiniteHits-item` - - -## 6. Start the app and search as you type - -Start the app by running: - -```bash -npm run dev -``` - -Now open your browser and navigate to your React app URL (e.g. `localhost:3000`), and start searching. - - - React app search UI with a search bar at the top and search results for a few video games - - -Encountering issues? Check out the code in action in our [live demo](https://codesandbox.io/p/sandbox/eager-dust-f98w2w)! - -## Next steps - -Want to search through your own data? [Create a project](https://cloud.meilisearch.com) in the Meilisearch Dashboard. Check out our [getting started guide](/learn/getting_started/cloud_quick_start) for step-by-step instructions. diff --git a/guides/front_end/vue_quick_start.mdx b/guides/front_end/vue_quick_start.mdx deleted file mode 100644 index 95b60ae7b..000000000 --- a/guides/front_end/vue_quick_start.mdx +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: Vue3 quick start -description: Integrate a search-as-you-type experience into your Vue app. ---- - -## 1. Create a Vue application - -Run the `npm create` tool to install base dependencies and create your app folder structure. - -```bash -npm create vue@latest my-app -``` - -## 2. Install the library of search components - -Navigate to your Vue app and install `vue-instantsearch`, `@meilisearch/instant-meilisearch`, and `instantsearch.css`. - -```bash -npm install vue-instantsearch @meilisearch/instant-meilisearch instantsearch.css -``` - -- [Vue InstantSearch](https://github.com/algolia/instantsearch/): front-end tools to customize your search environment -- [instant-meilisearch](https://github.com/meilisearch/meilisearch-js-plugins/tree/main/packages/instant-meilisearch): Meilisearch client to connect with Vue InstantSearch -- [instantsearch.css](https://github.com/algolia/instantsearch/tree/master/packages/instantsearch.css) (optional): CSS library to add basic styles to the search components - -## 3. Add InstantSearch - -Include InstantSearch into `main.js` to include the Vue InstantSearch library. - -```js -import { createApp } from 'vue'; -import App from './App.vue'; -import InstantSearch from 'vue-instantsearch/vue3/es'; - -const app = createApp(App); -app.use(InstantSearch); -app.mount('#app'); -``` - -## 4. Initialize the search client - -Add the code below to the `App.vue` file. - -```js - - - -``` - -These URL and API key point to a public Meilisearch instance that contains data from Steam video games. - -The `ais-instant-search` widget is the mandatory wrapper that allows you to configure your search. It takes two props: the `search-client` and the [`index-name`](/learn/getting_started/indexes#index-uid). - -## 5. Add a search bar and list search results - -Add the `ais-search-box` and `ais-hits` widgets inside the `ais-instant-search` wrapper widget. - -Import the CSS library to style the search components. - -``` - - - -``` - -Use the slot directive to customize how each search result is rendered. - - -Use the following CSS classes to add custom styles to your components: -`.ais-InstantSearch`, `.ais-SearchBox`, `.ais-InfiniteHits-list`, `.ais-InfiniteHits-item` - - -## 6.Start the app and search as you type - -Start the app by running: - -```bash -npm run dev -``` - -Now open your browser, navigate to your Vue app URL (e.g., `localhost:5173`), and start searching. - - - Vue app search UI with a search bar at the top and search results for a few video games - - -Encountering issues? Check out the code in action in our [live demo](https://codesandbox.io/p/sandbox/ms-vue3-is-forked-wsrkl8)! - -## Next steps - -Want to search through your own data? [Create a project](https://cloud.meilisearch.com) in the Meilisearch Dashboard. Check out our [getting started guide](/learn/getting_started/cloud_quick_start) for step-by-step instructions. diff --git a/guides/laravel_scout.mdx b/guides/laravel_scout.mdx deleted file mode 100644 index 14af52d78..000000000 --- a/guides/laravel_scout.mdx +++ /dev/null @@ -1,192 +0,0 @@ ---- -title: Laravel Scout guide -description: Learn how to use Meilisearch with Laravel Scout. -sidebarDepth: 3 ---- - -In this guide, you will see how to setup [Laravel Scout](https://laravel.com/docs/10.x/scout) to use Meilisearch in your Laravel 10 application. - -## Prerequisites - -Before you start, make sure you have the following installed on your machine: - -- PHP -- [Composer](https://getcomposer.org/) - -You will also need a Laravel application. If you don't have one, you can create a new one by running the following command: - -```sh -composer create-project laravel/laravel my-application -``` - -## Installing Laravel Scout - -Laravel comes with out-of-the-box full-text search capabilities via Laravel Scout. - -To enable it, navigate to your Laravel application directory and install Scout via the Composer package manager: - -```sh -composer require laravel/scout -``` - -After installing Scout, you need to publish the Scout configuration file. You can do this by running the following `artisan` command: - -```sh -php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider" -``` - -This command should create a new configuration file in your application directory: `config/scout.php`. - -## Configuring the Laravel Scout driver - -Now you need to configure Laravel Scout to use the Meilisearch driver. First, install the dependencies required to use Scout with Meilisearch via Composer: - -```sh -composer require meilisearch/meilisearch-php http-interop/http-factory-guzzle -``` - -Then, update the environment variables in your `.env` file: - -```sh -SCOUT_DRIVER=meilisearch -# Use the host below if you're running Meilisearch via Laravel Sail -MEILISEARCH_HOST=http://meilisearch:7700 -MEILISEARCH_KEY=masterKey -``` - -### Local development - -Laravel’s official Docker development environment, Laravel Sail, comes with a Meilisearch service out-of-the-box. Please note that when running Meilisearch via Sail, Meilisearch’s host is `http://meilisearch:7700` (instead of say, `http://localhost:7700`). - - -Check out Docker [Bridge network driver](https://docs.docker.com/network/drivers/bridge/#differences-between-user-defined-bridges-and-the-default-bridge) documentation for further detail. - - -### Running in production - -For production use cases, we recommend using a managed Meilisearch via [Meilisearch Cloud](https://www.meilisearch.com/cloud?utm_campaign=laravel&utm_source=docs&utm_medium=laravel-scout-guide). On Meilisearch Cloud, you can find your host URL in your project settings. - - -Read the [Meilisearch Cloud quick start](/learn/getting_started/cloud_quick_start). - - -If you prefer to self-host, read our guide for [running Meilisearch in production](/guides/running_production). - -## Making Eloquent models searchable - -With Scout installed and configured, add the `Laravel\Scout\Searchable` trait to your Eloquent models to make them searchable. This trait will use Laravel’s model observers to keep the data in your model in sync with Meilisearch. - -Here’s an example model: - -```php -belongsTo(Company::class); - } - - public function toSearchableArray(): array - { - // All model attributes are made searchable - $array = $this->toArray(); - - // Then we add some additional fields - $array['organization_id'] = $this->company->organization->id; - $array['company_name'] = $this->company->name; - $array['company_url'] = $this->company->url; - - return $array; - } -} -``` - -## Configuring filterable and sortable attributes - -Configure which attributes are [filterable](/learn/filtering_and_sorting/filter_search_results) and [sortable](/learn/filtering_and_sorting/sort_search_results) via your Meilisearch index settings. - -In Laravel, you can configure your index settings via the `config/scout.php` file: - -```php - [ - 'host' => env('MEILISEARCH_HOST', 'https://edge.meilisearch.com'), - 'key' => env('MEILISEARCH_KEY'), - 'index-settings' => [ - Contact::class => [ - 'filterableAttributes' => ['organization_id'], - 'sortableAttributes' => ['name', 'company_name'] - ], - ], - ], -]; -``` - -The example above updates Meilisearch index settings for the `Contact` model: - -- it makes the `organization_id` field filterable -- it makes the `name` and `company_name` fields sortable - -After changing your index settings, you will need to synchronize your Scout index settings. - -## Synchronizing your index settings - -To synchronize your index settings, run the following command: - -```sh -php artisan scout:sync-index-settings -``` - -## Example usage - -You built an example application to demonstrate how to use Meilisearch with Laravel Scout. It showcases an app-wide search in a CRM (Customer Relationship Management) application. - - - - Laravel Scout example application - - - -This demo application uses the following features: - -- [Multi-search](/reference/api/search/perform-a-multi-search) (search across multiple indexes) -- [Multi-tenancy](/learn/security/multitenancy_tenant_tokens) -- [Filtering](/learn/filtering_and_sorting/filter_search_results) -- [Sorting](/learn/filtering_and_sorting/sort_search_results) - -Of course, the code is open-sourced on [GitHub](https://github.com/meilisearch/saas-demo). 🎉 diff --git a/guides/ruby_on_rails_quick_start.mdx b/guides/ruby_on_rails_quick_start.mdx deleted file mode 100644 index 72b613b08..000000000 --- a/guides/ruby_on_rails_quick_start.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: Ruby on Rails quick start -description: Integrate Meilisearch into your Ruby on Rails app. ---- - -Integrate Meilisearch into your Ruby on Rails app. - -## 1. Create a Meilisearch project - -[Create a project](https://cloud.meilisearch.com) in the Meilisearch Cloud dashboard. Check out our [getting started guide](/learn/getting_started/cloud_quick_start) for step-by-step instructions. - -If you prefer to use the self-hosted version of Meilisearch, you can follow the [quick start](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch) tutorial. - -## 2. Create a Rails app - -Ensure your environment uses at least Ruby 2.7.0 and Rails 6.1. - -```bash -rails new blog -``` - -## 3. Install the meilisearch-rails gem - -Navigate to your Rails app and install the `meilisearch-rails` gem. - -```bash -bundle add meilisearch-rails -``` - -## 4. Add your Meilisearch credentials - -Run the following command to create a `config/initializers/meilisearch.rb` file. - -```bash -bin/rails meilisearch:install -``` - -Then add your Meilisearch URL and [Default Admin API Key](/learn/security/basic_security#obtaining-api-keys). On Meilisearch Cloud, you can find your credentials in your project settings. - -```Ruby -MeiliSearch::Rails.configuration = { - meilisearch_url: '', - meilisearch_api_key: '' -} -``` - -## 5. Generate the model and run the database migration - -Create an example `Article` model and generate the migration files. - -```bash -bin/rails generate model Article title:string body:text - -bin/rails db:migrate -``` - -## 6. Index your model into Meilisearch - -Include the `MeiliSearch::Rails` module and the `meilisearch` block. - -```Ruby -class Article < ApplicationRecord - include MeiliSearch::Rails - - meilisearch do - # index settings - # all attributes will be sent to Meilisearch if block is left empty - end -end -``` - -This code creates an `Article` index and adds search capabilities to your `Article` model. - -Once configured, `meilisearch-rails` automatically syncs your table data with your Meilisearch instance. - -## 7. Create new records in the database - -Use the Rails console to create new entries in the database. - -```bash -bin/rails console -``` - -```Ruby -# Use a loop to create and save 5 unique articles with predefined titles and bodies -titles = ["Welcome to Rails", "Exploring Rails", "Advanced Rails", "Rails Tips", "Rails in Production"] -bodies = [ - "This is your first step into Ruby on Rails.", - "Dive deeper into the Rails framework.", - "Explore advanced features of Rails.", - "Quick tips for Rails developers.", - "Managing Rails applications in production environments." -] - -titles.each_with_index do |title, index| - article = Article.new(title: title, body: bodies[index]) - article.save # Saves the entry to the database -end -``` - -## 8. Start searching - -### Backend search - -The backend search returns ORM-compliant objects reloaded from your database. - -```Ruby -# Meilisearch is typo-tolerant: -hits = Article.search('deepre') -hits.first -``` - -We strongly recommend using the frontend search to enjoy the swift and responsive search-as-you-type experience. - -### Frontend search - -For testing purposes, you can explore the records using our built-in [search preview](/learn/getting_started/search_preview). - -![Searching through Rails table data with Meilisearch search preview UI](/assets/images/rails_quick_start/rails-qs-search-preview.gif) - -We also provide resources to help you quickly build your own [frontend interface](/guides/front_end/front_end_integration). - -## Next steps - -When you're ready to use your own data, make sure to configure your [index settings](/reference/api/settings/list-all-settings) first to follow [best practices](/learn/indexing/indexing_best_practices). For a full configuration example, see the [meilisearch-rails gem README](https://github.com/meilisearch/meilisearch-rails?tab=readme-ov-file#%EF%B8%8F-settings). diff --git a/guides/strapi_v4.mdx b/guides/strapi_v4.mdx deleted file mode 100644 index 8062f6a20..000000000 --- a/guides/strapi_v4.mdx +++ /dev/null @@ -1,131 +0,0 @@ ---- -title: Strapi v4 guide -description: Learn how to use Meilisearch with Strapi v4. ---- - -This tutorial will show you how to integrate Meilisearch with [Strapi](https://strapi.io/) to create a search-based web app. First, you will use Strapi’s quick start guide to create a restaurant collection, and then search this collection with Meilisearch. - -## Prerequisites - -- [Node.js](https://nodejs.org/): active LTS or maintenance LTS versions, currently Node.js >=18.0.0 \<=20.x.x -- npm >=6.0.0 (installed with Node.js) -- A running instance of Meilisearch (v >= 1.x). If you need help with this part, you can consult the [Installation section](/learn/self_hosted/install_meilisearch_locally). - -## Create a back end using Strapi - -### Set up the project - -Create a directory called `my-app` where you will add the back and front-end parts of the application. Generate a back-end API using Strapi inside `my-app`: - -```bash -npx create-strapi-app@latest back --quickstart -``` - -This command creates a Strapi app in a new directory called `back` and opens the admin dashboard. Create an account to access it. - - - Strapi sign up form - - -Once you have created your account, you should be redirected to Strapi's admin dashboard. This is where you will configure your back-end API. - -### Build and manage your content - -The next step is to create a new collection type. A collection is like a blueprint of your content—in this case, it will be a collection of restaurants. You will create another collection called "Category" to organize your restaurants later. - - - Strapi dashboard with side menu 'Content-Type Builder' option circled - - -To follow along, complete "Part B: Build your data structure with the Content-type Builder" and steps 2 to 5 in "Part D: Add content to your Strapi Cloud project with the Content Manager" from Strapi's quick start guide. These will include: - -- creating collection types -- creating new entries -- setting roles & permissions -- publishing the content - -### Expand your database - -After finishing those steps of Strapi's quick start guide, two new collections named Restaurant and Category should have appeared under `Content Manager > Collection Types`. If you click on `Restaurant`, you can see that there is only one. Add more by clicking the `+ Create new entry` button in the upper-right corner of the dashboard. - - - Strapi dashboard: Content manager side menu, arrow indicating the location of the Restaurant Collection Type - - -Add the following three restaurants, one by one. For each restaurant, you need to press `Save` and then `Publish`. - -- Name: `The Butter Biscotte` -- Description: `All about butter, nothing about health.` - -Next, add the `French food` category on the bottom right corner of the page. - - - Strapi dashboard: create an entry form, arrow indicating the location of the categorie's location in the right side menu - - -- Name: `The Slimy Snail` -- Description: `Gastronomy is made of garlic and butter.` -- Category: `French food` - -- Name: `The Smell of Blue` -- Description: `Blue Cheese is not expired, it is how you eat it. With a bit of butter and a lot of happiness.` -- Category: `French food` - -Your Strapi back-end is now up and running. Strapi automatically creates a REST API for your Restaurants collection. Check Strapi's documentation for all available [API endpoints](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/content-api.html#api-endpoints). - -Now, it’s time to connect Strapi and Meilisearch and start searching. - -## Connect Strapi and Meilisearch - -To add the Meilisearch plugin to Strapi, you need to first quit the Strapi app. Go to the terminal window running Strapi and push `Ctrl+C` to kill the process. - -Next, install the plugin in the `back` directory. - -```bash -npm install strapi-plugin-meilisearch -``` - -After the installation, you have to rebuild the Strapi app before starting it again in development mode, since it makes configuration easier. - -```bash -npm run build -npm run develop -``` - -At this point, your Strapi app should be running once again on the default address: http://localhost:1337/admin. Open it in your browser. You should see an admin log-in page. Enter the credentials you used to create your account. - -Once connected, you should see the new `meilisearch` plugin on the left side of the screen. - - - Strapi dashboard with plugins side menu: arrow pointing at the 'meilisearch' option - - -Add your Meilisearch credentials on the Settings tab of the `meilisearch` plugin page. - - - Strapi dashboard with Meilisearch plugin selected: arrow pointing to the location of the settings tab - - -Now it's time to add your Strapi collection to Meilisearch. In the `Collections` tab on the `meilisearch` plugin page, you should see the `restaurant` and `category` content-types. - -By clicking on the checkbox next to `restaurant`, the content-type is automatically indexed in Meilisearch. - - - GIF showing the mouse clicking on 'restaurant' in the Meilisearch collections tab - - -The word “Hooked” appears when you click on the `restaurant`'s checkbox in the `Collections` tab. This means that each time you add, update or delete an entry in your restaurant content-types, Meilisearch is automatically updated. - -Once the indexing finishes, your restaurants are in Meilisearch. Access the [search preview](/learn/getting_started/search_preview) confirm everything is working correctly by searching for “butter”. - - - GIF showing the word 'butter' being typed in the search bar and search results appearing instantly - - -Your Strapi entries are sent to Meilisearch as is. You can modify the data before sending it to Meilisearch, for instance by removing a field. Check out all the customization options on the [strapi-plugin-meilisearch page](https://github.com/meilisearch/strapi-plugin-meilisearch/#-customization). - -## What's next - -This tutorial showed you how to add your Strapi collections to Meilisearch. - -In most real-life scenarios, you'll typically build a custom search interface and fetch results using Meilisearch's API. To learn how to quickly build a front-end interface of your own, check out the [Front-end integration page](/guides/front_end/front_end_integration) guide. diff --git a/guides/vercel.mdx b/guides/vercel.mdx deleted file mode 100644 index f28098dc9..000000000 --- a/guides/vercel.mdx +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: Integrate Meilisearch Cloud with Vercel -description: Link Meilisearch Cloud to a Vercel Project. ---- - -In this guide you will learn how to link a [Meilisearch Cloud](https://www.meilisearch.com/cloud?utm_campaign=oss&utm_source=docs&utm_medium=vercel-integration) instance to your Vercel project. - -## Introducing our tools - -### What is Vercel? - -[Vercel](https://vercel.com/) is a cloud platform for building and deploying web applications. It works out of the box with most popular web development tools. - -### What is Meilisearch Cloud? - -[Meilisearch Cloud](https://www.meilisearch.com/cloud?utm_campaign=oss&utm_source=docs&utm_medium=vercel-integration) offers a managed search service that is scalable, reliable, and designed to meet the needs of all companies. - -## Integrate Meilisearch into your Vercel project - -### Create and deploy a Vercel project - -From your Vercel dashboard, create a new project. You can create a project from a template, or import a Git repository. - - - Create a new project on Vercel dashboard - - -Select your project, then click on **Deploy**. Once deployment is complete, go back to your project’s dashboard. - -### Add the Meilisearch integration - -Go to the project settings tab and click on **Integrations** on the sidebar menu to the left of your screen. - - - Selecting the integration tab in the project settings - - -Search for the [Meilisearch integration](https://vercel.com/integrations/meilisearch-cloud) in the search bar. Click on the **Add integration** button. - - - Meilisearch integration page in Vercel's marketplace - - -Select the Vercel account or team and the project you to which you want to add the integration. You may add the Meilisearch integration to one or more projects in this menu. - - - Form to add Meilisearch integration, the 'Specific projects' option is selected - - -Click on **Continue**. Vercel will display a list with the permissions the integration needs to work properly. Review it, then click on **Add Integration**. - -### Set up Meilisearch Cloud - -Vercel will redirect you to the Meilisearch Cloud page. Log in or create an account. New accounts enjoy a 14-day free trial period. - -You can choose an existing project or create a new one. To create a new project, complete the form with the project name and region. - - - Meilisearch Cloud form to create a project complete, with 'search-app' as the project's name and 'Frankfurt' as the region - - -Once you click on **Create project**, you should see the following message: “Your Meilisearch + Vercel integration is one click away from being completed.” Click "Finish the Vercel integration setup". Meilisearch will then redirect you back to the Vercel integration page. - - - Meilisearch integration page in Vercel's dashboard - - -### Understand and use Meilisearch API keys - -Meilisearch creates [four default API keys](/learn/security/basic_security#obtaining-api-keys): `Default Search API Key`, `Default Admin API Key`, `Default Read-Only Admin API Key`, and `Default Chat API Key`. - -#### Admin API key - -Use the `Default Admin API Key`, to control who can access or create new documents, indexes, and change index settings. Be careful with the admin key and avoid exposing it in public environments. - -#### Search API key - -Use the `Default Search API Key` to access the [search route](/reference/api/search/search-with-post). This is the one you want to use in your front end. - -The Search and Admin API keys are automatically added to Vercel along with the Meilisearch URL. For more information on the other default keys, consult the [security documentation](/learn/security/basic_security#obtaining-api-keys). - - -The master key–which hasn’t been added to Vercel–grants users full control over an instance. You can find it in your project’s overview on your [Meilisearch Cloud dashboard](https://cloud.meilisearch.com/projects/?utm_campaign=oss&utm_source=docs&utm_medium=vercel-integration). Read more about [Meilisearch security](https://www.meilisearch.com/docs/learn/security/master_api_keys). - - -### Review your project settings - -Go back to your project settings and check the new Meilisearch environment variables: - -- `MEILISEARCH_ADMIN_KEY` -- `MEILISEARCH_URL` -- `MEILISEARCH_SEARCH_KEY` - - - Display the environment variables in the project settings - - - -When using [Next.js](https://nextjs.org/), ensure you prefix your browser-facing environment variables with `NEXT_PUBLIC_`. This makes them available to the browser side of your application. - - -## Take advantage of the Meilisearch Cloud dashboard - - - Meilisearch Cloud dashboard: overview of the 'search-app' project - - -Use the [Meilisearch Cloud dashboard](https://cloud.meilisearch.com/projects/?utm_campaign=oss&utm_source=docs&utm_medium=vercel-integration), to index documents and manage your project settings. - -## Resources and next steps - -Check out the [quick start guide](/learn/self_hosted/getting_started_with_self_hosted_meilisearch#add-documents) for a short introduction on how to use Meilisearch. We also provide many [SDKs and tools](/learn/resources/sdks), so you can use Meilisearch in your favorite language or framework. - -You are now ready to [start searching](/reference/api/search/search-with-post)! From 7cee5732bfa223e598568dea6cc77aeb8fefbf1b Mon Sep 17 00:00:00 2001 From: Quentin de Quelen Date: Thu, 12 Mar 2026 19:56:04 +0100 Subject: [PATCH 3/4] Fix broken links, typos, and formatting in getting started pages - Fix multi-search link pointing to wrong endpoint in laravel.mdx - Fix "Github" capitalization to "GitHub" in laravel.mdx - Fix broken /products/... card links in symfony.mdx and meilisync.mdx - Fix "categorie's" typo in strapi.mdx alt text - Fix missing space in "6.Start" heading in vue.mdx - Fix broken glossary links in react.mdx and vue.mdx - Fix "indexUId" capitalization in postman.mdx alt text - Use absolute paths for card hrefs in overview.mdx Entire-Checkpoint: 9c68757644a6 --- getting_started/frameworks/laravel.mdx | 4 ++-- getting_started/frameworks/strapi.mdx | 2 +- getting_started/frameworks/symfony.mdx | 6 +++--- getting_started/instant_meilisearch/react.mdx | 2 +- getting_started/instant_meilisearch/vue.mdx | 4 ++-- getting_started/integrations/meilisync.mdx | 2 +- getting_started/integrations/postman.mdx | 2 +- getting_started/overview.mdx | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/getting_started/frameworks/laravel.mdx b/getting_started/frameworks/laravel.mdx index 9a0fbbe2a..cd4b691d1 100644 --- a/getting_started/frameworks/laravel.mdx +++ b/getting_started/frameworks/laravel.mdx @@ -183,9 +183,9 @@ You built an example application to demonstrate how to use Meilisearch with Lara This demo application uses the following features: -- [Multi-search](/reference/api/search/search-with-post) (search across multiple indexes) +- [Multi-search](/reference/api/search/perform-a-multi-search) (search across multiple indexes) - [Multi-tenancy](/learn/security/multitenancy_tenant_tokens) - [Filtering](/learn/filtering_and_sorting/filter_search_results) - [Sorting](/learn/filtering_and_sorting/sort_search_results) -Of course, the code is open-sourced on [Github](https://github.com/meilisearch/saas-demo). 🎉 +Of course, the code is open-sourced on [GitHub](https://github.com/meilisearch/saas-demo). 🎉 diff --git a/getting_started/frameworks/strapi.mdx b/getting_started/frameworks/strapi.mdx index 8431c3fe9..eaba99fb8 100644 --- a/getting_started/frameworks/strapi.mdx +++ b/getting_started/frameworks/strapi.mdx @@ -61,7 +61,7 @@ Add the following three restaurants, one by one. For each restaurant, you need t Next, add the `French food` category on the bottom right corner of the page. - Strapi dashboard: create an entry form, arrow indicating the location of the categorie's location in the right side menu + Strapi dashboard: create an entry form, arrow indicating the category's location in the right side menu - Name: `The Slimy Snail` diff --git a/getting_started/frameworks/symfony.mdx b/getting_started/frameworks/symfony.mdx index ff660badb..13c103771 100644 --- a/getting_started/frameworks/symfony.mdx +++ b/getting_started/frameworks/symfony.mdx @@ -193,13 +193,13 @@ class MyService ## Next steps - + Configure ranking and relevancy - + Add filters and facets - + Add semantic search diff --git a/getting_started/instant_meilisearch/react.mdx b/getting_started/instant_meilisearch/react.mdx index 1cd5106a3..795f992ca 100644 --- a/getting_started/instant_meilisearch/react.mdx +++ b/getting_started/instant_meilisearch/react.mdx @@ -42,7 +42,7 @@ const { searchClient } = instantMeiliSearch( ## 4. Add the InstantSearch provider -`` is the root provider component for the InstantSearch library. It takes two props: the `searchClient` and the [index name](/getting_started/glossary/indexes#index-uid). +`` is the root provider component for the InstantSearch library. It takes two props: the `searchClient` and the [index name](/learn/getting_started/indexes#index-uid). ```jsx import React from 'react'; diff --git a/getting_started/instant_meilisearch/vue.mdx b/getting_started/instant_meilisearch/vue.mdx index 3ebb3f56f..18ce6d97b 100644 --- a/getting_started/instant_meilisearch/vue.mdx +++ b/getting_started/instant_meilisearch/vue.mdx @@ -66,7 +66,7 @@ export default { These URL and API key point to a public Meilisearch instance that contains data from Steam video games. -The `ais-instant-search` widget is the mandatory wrapper that allows you to configure your search. It takes two props: the `search-client` and the [`index-name`](/getting_started/glossary/indexes#index-uid). +The `ais-instant-search` widget is the mandatory wrapper that allows you to configure your search. It takes two props: the `search-client` and the [`index-name`](/learn/getting_started/indexes#index-uid). ## 5. Add a search bar and list search results @@ -114,7 +114,7 @@ Use the following CSS classes to add custom styles to your components: `.ais-InstantSearch`, `.ais-SearchBox`, `.ais-InfiniteHits-list`, `.ais-InfiniteHits-item` -## 6.Start the app and search as you type +## 6. Start the app and search as you type Start the app by running: diff --git a/getting_started/integrations/meilisync.mdx b/getting_started/integrations/meilisync.mdx index 4d44ef697..cff2bcfae 100644 --- a/getting_started/integrations/meilisync.mdx +++ b/getting_started/integrations/meilisync.mdx @@ -271,7 +271,7 @@ sync: Set up searchable and filterable attributes - + Configure ranking and relevancy diff --git a/getting_started/integrations/postman.mdx b/getting_started/integrations/postman.mdx index e3aed17f4..96a06c3a7 100644 --- a/getting_started/integrations/postman.mdx +++ b/getting_started/integrations/postman.mdx @@ -33,7 +33,7 @@ Set the "Token" if needed (set to `masterKey` by default): Set `url` (set to Meilisearch's local port by default) and `indexUID` (set to `indexUID` by default): - Setting the 'URL' to http://localhost:7700/ and 'indexUID' to indexUId in the Variables tab. + Setting the 'URL' to http://localhost:7700/ and 'indexUID' to indexUID in the Variables tab. The `url` and `indexUID` variables are used in all the collection routes, like in this one: diff --git a/getting_started/overview.mdx b/getting_started/overview.mdx index 7fa43b87c..63cbba0f9 100644 --- a/getting_started/overview.mdx +++ b/getting_started/overview.mdx @@ -48,10 +48,10 @@ Try our live demos: ## Next steps - + Discover all Meilisearch capabilities - + Get started with your preferred language From 602546aacc6eda781e4920ff295cba64981acd0a Mon Sep 17 00:00:00 2001 From: Quentin de Quelen Date: Thu, 12 Mar 2026 20:00:38 +0100 Subject: [PATCH 4/4] Fix multi-search endpoint URL to correct path Update multi-search link in laravel.mdx and redirect in docs.json to use /reference/api/multi-search/perform-a-multi-search Entire-Checkpoint: 9c68757644a6 --- docs.json | 2 +- getting_started/frameworks/laravel.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs.json b/docs.json index d280bc602..a1c3a7f88 100644 --- a/docs.json +++ b/docs.json @@ -1458,7 +1458,7 @@ }, { "source": "/reference/api/multi_search", - "destination": "/reference/api/search/perform-a-multi-search" + "destination": "/reference/api/multi-search/perform-a-multi-search" }, { "source": "/reference/api/network", diff --git a/getting_started/frameworks/laravel.mdx b/getting_started/frameworks/laravel.mdx index cd4b691d1..47c36a3cd 100644 --- a/getting_started/frameworks/laravel.mdx +++ b/getting_started/frameworks/laravel.mdx @@ -183,7 +183,7 @@ You built an example application to demonstrate how to use Meilisearch with Lara This demo application uses the following features: -- [Multi-search](/reference/api/search/perform-a-multi-search) (search across multiple indexes) +- [Multi-search](/reference/api/multi-search/perform-a-multi-search) (search across multiple indexes) - [Multi-tenancy](/learn/security/multitenancy_tenant_tokens) - [Filtering](/learn/filtering_and_sorting/filter_search_results) - [Sorting](/learn/filtering_and_sorting/sort_search_results)