# This code-samples file is used by the Meilisearch documentation
# Every example written here will be automatically fetched by
# the documentation on build
---
## BEGIN /reference/api
# get_indexes_indexUid
get_one_index_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies'
# get_indexes
list_all_indexes_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes?limit=3'
# post_indexes
create_an_index_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "uid": "movies",
      "primaryKey": "id"
    }'
# patch_indexes_indexUid
update_an_index_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/movies' \
    -H 'Content-Type: application/json' \
    --data-binary '{ "primaryKey": "id" }'
# delete_indexes_indexUid
delete_an_index_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies'
# get_indexes_indexUid_documents_documentId
get_one_document_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/documents/25684?fields=id,title,poster,release_date'
# get_indexes_indexUid_documents
get_documents_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/documents?limit=2&filter=genres=action'
# post_indexes_indexUid_documents
add_or_replace_documents_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movies/documents' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      {
        "id": 287947,
        "title": "Shazam",
        "poster": "https://image.tmdb.org/t/p/w1280/xnopI5Xtky18MPhK40cZAGAOVeV.jpg",
        "overview": "A boy is given the ability to become an adult superhero in times of need with a single magic word.",
        "release_date": "2019-03-23"
      }
    ]'
add_or_replace_documents_csv_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movies/documents' \
    -H 'Content-Type: text/csv' \
    --data-binary @movies.csv
add_or_replace_documents_ndjson_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movies/documents' \
    -H 'Content-Type: application/x-ndjson' \
    --data-binary @movies.ndjson
# put_indexes_indexUid_documents
add_or_update_documents_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/documents' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      {
        "id": 287947,
        "title": "Shazam ⚡️",
        "genres": "comedy"
      }
    ]'
# delete_indexes_indexUid_documents
delete_all_documents_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/documents'
# delete_indexes_indexUid_documents_documentId
delete_one_document_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/documents/25684'
# post_indexes_indexUid_documents_delete_batch
delete_documents_by_batch_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movies/documents/delete-batch' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      23488,
      153738,
      437035,
      363869
    ]'
# post_indexes_indexUid_search
search_post_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movies/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{ "q": "american ninja" }'
# get_indexes_indexUid_search
search_get_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/search?q=american%20ninja'
# get_tasks
get_all_tasks_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/tasks'
# get_tasks_taskId
get_task_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/tasks/1'
# get_tasks_taskId_documents
get_task_documents_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/tasks/1/documents'
get_all_tasks_paginating_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/tasks?limit=2&from=10
get_all_tasks_paginating_2: |-
  curl \
    -X GET 'MEILISEARCH_URL/tasks?limit=2&from=8
# get_keys_key
get_one_key_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/keys/6062abda-a5aa-4414-ac91-ecd7944c0f8d' \
    -H 'Authorization: Bearer MASTER_KEY'
# get_keys
get_all_keys_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/keys?limit=3' \
    -H 'Authorization: Bearer MASTER_KEY'
# post_keys
create_a_key_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/keys' \
    -H 'Authorization: Bearer MASTER_KEY' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "description": "Add documents: Products API key",
      "actions": ["documents.add"],
      "indexes": ["products"],
      "expiresAt": "2042-04-02T00:42:42Z"
    }'
# patch_keys_key
update_a_key_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/keys/6062abda-a5aa-4414-ac91-ecd7944c0f8d' \
    -H 'Authorization: Bearer MASTER_KEY' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "name": "Products/Reviews API key",
      "description": "Manage documents: Products/Reviews API key"
    }'
# delete_keys_key
delete_a_key_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/keys/6062abda-a5aa-4414-ac91-ecd7944c0f8d' \
    -H 'Authorization: Bearer MASTER_KEY'

### BEGIN settings + subroutes
# get_indexes_indexUid_settings
get_settings_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/settings'
# patch_indexes_indexUid_settings
update_settings_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/movies/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "rankingRules": [
        "words",
        "typo",
        "proximity",
        "attributeRank",
        "sort",
        "wordPosition",
        "exactness",
        "release_date:desc",
        "rank:desc"
      ],
      "distinctAttribute": "movie_id",
      "searchableAttributes": [
        "title",
        "overview",
        "genres"
      ],
      "displayedAttributes": [
        "title",
        "overview",
        "genres",
        "release_date"
      ],
      "stopWords": [
        "the",
        "a",
        "an"
      ],
      "sortableAttributes": [
        "title",
        "release_date"
      ],
      "synonyms": {
        "wolverine": [
          "xmen",
          "logan"
      ],
        "logan": ["wolverine"]
      },
      "typoTolerance": {
        "minWordSizeForTypos": {
          "oneTypo": 8,
          "twoTypos": 10
        },
        "disableOnAttributes": ["title"]
      },
      "pagination": {
        "maxTotalHits": 5000
      },
      "faceting": {
        "maxValuesPerFacet": 200
      },
      "searchCutoffMs": 150
    }'
# delete_indexes_indexUid_settings
reset_settings_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/settings'
# get_indexes_indexUid_settings_synonyms
get_synonyms_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/settings/synonyms'
# put_indexes_indexUid_settings_synonyms
update_synonyms_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/settings/synonyms' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "wolverine": [
        "xmen",
        "logan"
      ],
      "logan": [
        "wolverine",
        "xmen"
      ],
      "wow": ["world of warcraft"]
    }'
# delete_indexes_indexUid_settings_synonyms
reset_synonyms_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/settings/synonyms'
# get_indexes_indexUid_settings_stop_words
get_stop_words_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/settings/stop-words'
# put_indexes_indexUid_settings_stop_words
update_stop_words_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/settings/stop-words' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "the",
      "of",
      "to"
    ]'
# delete_indexes_indexUid_settings_stop_words
reset_stop_words_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/settings/stop-words'
# get_indexes_indexUid_settings_ranking_rules
get_ranking_rules_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/settings/ranking-rules'
# put_indexes_indexUid_settings_ranking_rules
update_ranking_rules_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/settings/ranking-rules' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "words",
      "typo",
      "proximity",
      "attributeRank",
      "sort",
      "wordPosition",
      "exactness",
      "release_date:asc",
      "rank:desc"
    ]'
# delete_indexes_indexUid_settings_ranking_rules
reset_ranking_rules_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/settings/ranking-rules'
# get_indexes_indexUid_settings_distinct_attribute
get_distinct_attribute_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/shoes/settings/distinct-attribute'
# put_indexes_indexUid_settings_distinct_attribute
update_distinct_attribute_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/shoes/settings/distinct-attribute' \
    -H 'Content-Type: application/json' \
    --data-binary '"skuid"'
# delete_indexes_indexUid_settings_distinct_attribute
reset_distinct_attribute_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/shoes/settings/distinct-attribute'
# get_indexes_indexUid_settings_filterable_attributes
get_filterable_attributes_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/settings/filterable-attributes'
# put_indexes_indexUid_settings_filterable_attributes
update_filterable_attributes_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/settings/filterable-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "genres",
      "director",
      {
        "attributePatterns": ["*_ratings"],
        "features": {
          "facetSearch": false,
          "filter": {
            "equality": true,
            "comparison": false
          }
        }
      }
    ]'
# delete_indexes_indexUid_settings_filterable_attributes
reset_filterable_attributes_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/settings/filterable-attributes'
# get_indexes_indexUid_settings_searchable_attributes
get_searchable_attributes_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/settings/searchable-attributes'
# put_indexes_indexUid_settings_searchable_attributes
update_searchable_attributes_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/settings/searchable-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "title",
      "overview",
      "genres"
    ]'
# delete_indexes_indexUid_settings_searchable_attributes
reset_searchable_attributes_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/settings/searchable-attributes'
# get_indexes_indexUid_settings_displayed_attributes
get_displayed_attributes_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/settings/displayed-attributes'
# put_indexes_indexUid_settings_displayed_attributes
update_displayed_attributes_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/settings/displayed-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "title",
      "overview",
      "genres",
      "release_date"
    ]'
# delete_indexes_indexUid_settings_displayed_attributes
reset_displayed_attributes_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/settings/displayed-attributes'
# get_indexes_indexUid_settings_sortable_attributes
get_sortable_attributes_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/books/settings/sortable-attributes'
# put_indexes_indexUid_settings_sortable_attributes
update_sortable_attributes_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/books/settings/sortable-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "price",
      "author"
    ]'
# delete_indexes_indexUid_settings_sortable_attributes
reset_sortable_attributes_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/books/settings/sortable-attributes'
# get_indexes_indexUid_settings_typo_tolerance
get_typo_tolerance_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/books/settings/typo-tolerance'
# patch_indexes_indexUid_settings_typo_tolerance
update_typo_tolerance_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/books/settings/typo-tolerance' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "minWordSizeForTypos": {
        "oneTypo": 4,
        "twoTypos": 10
      },
      "disableOnAttributes": ["title"]
    }'
# delete_indexes_indexUid_settings_typo_tolerance
reset_typo_tolerance_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/books/settings/typo-tolerance'
# get_indexes_indexUid_settings_pagination
get_pagination_settings_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/books/settings/pagination'
# patch_indexes_indexUid_settings_pagination
update_pagination_settings_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/books/settings/pagination' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "maxTotalHits": 100
    }'
# delete_indexes_indexUid_settings_pagination
reset_pagination_settings_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/books/settings/pagination'
# get_indexes_indexUid_settings_faceting
get_faceting_settings_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/books/settings/faceting'
# patch_indexes_indexUid_settings_faceting
update_faceting_settings_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/books/settings/faceting' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "maxValuesPerFacet": 2,
      "sortFacetValuesBy": {
        "*": "alpha",
        "genres": "count"
      }
    }'
update_faceting_settings_max_values_per_facet_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/books/settings/faceting' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "maxValuesPerFacet": 20
    }'
# delete_indexes_indexUid_settings_faceting
reset_faceting_settings_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/books/settings/faceting'
# get_indexes_indexUid_settings_separator_tokens
get_separator_tokens_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/articles/settings/separator-tokens'
# put_indexes_indexUid_settings_separator_tokens
update_separator_tokens_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/articles/settings/separator-tokens' \
    -H 'Content-Type: application/json'  \
    --data-binary '["|", "&hellip;"]'
# delete_indexes_indexUid_settings_separator_tokens
reset_separator_tokens_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/articles/settings/separator-tokens'
# get_indexes_indexUid_settings_non_separator_tokens
get_non_separator_tokens_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/articles/settings/non-separator-tokens'
# put_indexes_indexUid_settings_non_separator_tokens
update_non_separator_tokens_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/articles/settings/non-separator-tokens' \
    -H 'Content-Type: application/json'  \
    --data-binary '["@", "#"]'
# delete_indexes_indexUid_settings_non_separator_tokens
reset_non_separator_tokens_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/articles/settings/non-separator-tokens'
# get_indexes_indexUid_settings_dictionary
get_dictionary_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/books/settings/dictionary'
# put_indexes_indexUid_settings_dictionary
update_dictionary_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/books/settings/dictionary' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "J. R. R.",
      "W. E. B."
    ]'
# delete_indexes_indexUid_settings_dictionary
reset_dictionary_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/books/settings/dictionary'
# get_indexes_indexUid_settings_proximity_precision
get_proximity_precision_settings_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/books/settings/proximity-precision'
# put_indexes_indexUid_settings_proximity_precision
update_proximity_precision_settings_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/books/settings/proximity-precision' \
    -H 'Content-Type: application/json' \
    --data-binary '"byAttribute"'
# delete_indexes_indexUid_settings_proximity_precision
reset_proximity_precision_settings_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/books/settings/proximity-precision'
# get_indexes_indexUid_settings_facet_search
get_facet_search_settings_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/INDEX_UID/settings/facet-search'
# put_indexes_indexUid_settings_facet_search
update_facet_search_settings_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/INDEX_UID/settings/facet-search' \
    -H 'Content-Type: application/json' \
    --data-binary 'false'
# delete_indexes_indexUid_settings_facet_search
reset_facet_search_settings_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/INDEX_UID/settings/facet-search'
# get_indexes_indexUid_settings_prefix_search
get_prefix_search_settings_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/INDEX_UID/settings/prefix-search'
# put_indexes_indexUid_settings_prefix_search
update_prefix_search_settings_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/INDEX_UID/settings/prefix-search' \
    -H 'Content-Type: application/json' \
    --data-binary '"disabled"'
# delete_indexes_indexUid_settings_prefix_search
reset_prefix_search_settings_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/INDEX_UID/settings/prefix-search'
# get_indexes_indexUid_settings_search_cutoff_ms
get_search_cutoff_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/settings/search-cutoff-ms'
# put_indexes_indexUid_settings_search_cutoff_ms
update_search_cutoff_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/settings/search-cutoff-ms' \
    -H 'Content-Type: application/json' \
    --data-binary '150'
# delete_indexes_indexUid_settings_search_cutoff_ms
reset_search_cutoff_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/movies/settings/search-cutoff-ms'
# get_indexes_indexUid_settings_localized_attributes
get_localized_attribute_settings_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/localized-attributes'
# put_indexes_indexUid_settings_localized_attributes
update_localized_attribute_settings_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/localized-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      {"locales": ["jpn"], "attributePatterns": ["*_ja"]}
    ]'
multilingual_dataset_guide_update_localized_attributes_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/localized-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      { "attributePatterns": ["*_en"], "locales": ["eng"] },
      { "attributePatterns": ["*_de"], "locales": ["deu"] },
      { "attributePatterns": ["*_fr"], "locales": ["fra"] }
    ]'
# delete_indexes_indexUid_settings_localized_attributes
reset_localized_attribute_settings_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/localized-attributes'
# get_indexes_indexUid_settings_embedders
get_embedders_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/embedders'
# patch_indexes_indexUid_settings_embedders
update_embedders_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/embedders' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "default": {
        "source":  "openAi",
        "apiKey": "OPEN_AI_API_KEY",
        "model": "text-embedding-3-small",
        "documentTemplate": "A document titled '{{doc.title}}' whose description starts with {{doc.overview|truncatewords: 20}}"
      }
    }'
update_embedders_distribution_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/INDEX_NAME/settings' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer MEILISEARCH_KEY' \
    --data-binary '{
      "embedders": {
        "default": {
          "source": "openAi",
          "model": "text-embedding-3-small",
          "distribution": {
            "mean": 0.7,
            "sigma": 0.3
          }
        }
      }
    }'
# delete_indexes_indexUid_settings_embedders
reset_embedders_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/embedders'
# get_indexes_indexUid_settings_chat
get_chat_settings_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/chat'
# patch_indexes_indexUid_settings_chat
update_chat_settings_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/chat' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "description": "An index of movies.",
      "documentTemplate": "A movie titled '{{doc.title}}' released in {{ doc.release_date }}",
      "documentTemplateMaxBytes": 400
    }'
# delete_indexes_indexUid_settings_chat
reset_chat_settings_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/chat'
### END settings + subroutes
# post_dumps
post_dump_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/dumps'
# delete_tasks
delete_tasks_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/tasks?uids=1,2'
# post_tasks_cancel
cancel_tasks_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/tasks/cancel?uids=1,2'
# post_swap_indexes
swap_indexes_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/swap-indexes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      {
        "indexes": [
          "indexA",
          "indexB"
        ]
      },
      {
        "indexes": [
          "indexX",
          "indexY"
        ]
      }
    ]'
# post_multi_search
multi_search_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/multi-search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "queries": [
        {
          "indexUid": "movies",
          "q": "pooh",
          "limit": 5
        },
        {
          "indexUid": "movies",
          "q": "nemo",
          "limit": 5
        },
        {
          "indexUid": "movie_ratings",
          "q": "us"
        }
      ]
    }'
# post_indexes_indexUid_documents_fetch
get_documents_post_1: |-
  curl \
    -X POST MEILISEARCH_URL/indexes/books/documents/fetch \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "filter": "(rating > 3 AND (genres = Adventure OR genres = Fiction)) AND language = English",
      "fields": ["title", "genres", "rating", "language"],
      "limit": 3
    }'
get_documents_post_with_filter_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movies/documents/fetch' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "filter": "genres = Action AND rating > 8"
    }'
# post_indexes_indexUid_documents_delete
delete_documents_by_filter_1: |-
  curl \
    -X POST MEILISEARCH_URL/indexes/movies/documents/delete \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "filter": "genres = action OR genres = adventure"
    }'
# post_indexes_indexUid_documents_edit
edit_documents_by_function_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movies/documents/edit' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "function": "doc.new_field = `a]new[value`",
      "filter": "id > 3000",
      "context": {
        "max_title_length": 10
      }
    }'
# get_experimental_features
get_experimental_features_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/experimental-features/'
# patch_experimental_features
update_experimental_features_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/experimental-features/' \
    -H 'Content-Type: application/json'  \
    --data-binary '{
      "metrics": true
    }'
# post_indexes_indexUid_facet_search
facet_search_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/books/facet-search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "facetQuery": "fiction",
      "facetName": "genres",
      "filter": "rating > 3"
    }'
# post_snapshots
create_snapshot_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/snapshots'
# get_batches
get_all_batches_1: |-
  curl \
    -X GET 'http://MEILISEARCH_URL/batches'
# get_batches_batchId
get_batch_1: |-
  curl \
    -X GET 'http://MEILISEARCH_URL/batches/BATCH_UID'
# post_indexes_indexUid_similar
get_similar_post_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/similar' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
    --data-binary '{
      "id": TARGET_DOCUMENT_ID,
      "embedder": "EMBEDDER_NAME"
    }'
# get_indexes_indexUid_similar
get_similar_get_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/INDEX_NAME/similar?id=TARGET_DOCUMENT_ID&embedder=EMBEDDER_NAME'
# post_export
export_post_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/export' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "url": "TARGET_INSTANCE_URL",
      "indexes": {
        "*": {
          "overrideSettings": true
        }
      }
    }'
# get_webhooks
webhooks_get_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/webhooks'
# get_webhooks_uuid
webhooks_get_single_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/webhooks/WEBHOOK_UUID'
# post_webhooks
webhooks_post_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/webhooks' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "url": "WEBHOOK_TARGET_URL",
      "headers": {
        "authorization": "SECURITY_KEY",
        "referer": "https://example.com"
      }
    }'
# patch_webhooks_uuid
webhooks_patch_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/webhooks/WEBHOOK_UUID' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "header": {
        "referer": null
      }
    }'
# delete_webhooks_uuid
webhooks_delete_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/webhooks/WEBHOOK_UUID'
# post_indexes_indexUid_compact
compact_index_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_UID/compact'
# get_metrics
experimental_get_metrics_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/metrics'
# post_logs_stderr
experimental_post_logs_stderr_1: |-
  curl \
    -X POST MEILISEARCH_URL/logs/stderr \
    -H 'Content-Type: application/json' \
    --data-binary '{
        "target": "milli=trace,index_scheduler=info,actix_web=off"
    }'
# post_logs_stream
experimental_post_logs_stream_1: |-
  curl \
    -X POST MEILISEARCH_URL/logs/stream \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "mode": "human",
      "target": "index_scheduler=trace"
    }'
# delete_logs_stream
experimental_delete_logs_stream_1: |-
  curl \
    -X DELETE MEILISEARCH_URL/logs/stream
  }'
# get_network
get_network_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/network'
# patch_network
update_network_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/network' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "self": "ms-00",
      "remotes": {
        "ms-00": {
          "url": "http://INSTANCE_URL",
          "searchApiKey": "INSTANCE_API_KEY"
        },
        "ms-01": {
          "url": "http://ANOTHER_INSTANCE_URL",
          "searchApiKey": "ANOTHER_INSTANCE_API_KEY"
        }
      }
    }'
# get_indexes_indexUid_stats
get_index_stats_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/movies/stats'
# get_stats
get_indexes_stats_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/stats'
# get_health
get_health_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/health'
# get_version
get_version_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/version'
## END /reference/api
distinct_attribute_guide_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/jackets/settings/distinct-attribute' \
    -H 'Content-Type: application/json' \
    --data-binary '"product_id"'
field_properties_guide_displayed_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/settings/displayed-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
        "title",
        "overview",
        "genres",
        "release_date"
      ]'
filtering_guide_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movie_ratings/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "Avengers",
      "filter": "release_date > 795484800"
    }'
filtering_guide_2: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movie_ratings/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "Batman",
      "filter": "release_date > 795484800 AND (director = \"Tim Burton\" OR director = \"Christopher Nolan\")"
    }'
filtering_guide_3: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movie_ratings/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "Planet of the Apes",
      "filter": "release_date > 1577884550 AND (NOT director = \"Tim Burton\")"
    }' \
filtering_guide_nested_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movie_ratings/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "thriller",
      "filter": "rating.users >= 90"
    }'
add_movies_json_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movies/documents'\
    -H 'Content-Type: application/json' \
    --data-binary @movies.json
getting_started_add_documents: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movies/documents?primaryKey=id' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer aSampleMasterKey' \
    --data-binary @movies.json
getting_started_check_task_status: |-
  curl \
    -X GET 'MEILISEARCH_URL/tasks/0' \
    -H 'Authorization: Bearer aSampleMasterKey'
getting_started_search: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/movies/search' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer aSampleMasterKey' \
    --data-binary '{ "q": "botman" }'
authorization_header_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/keys' \
    -H 'Authorization: Bearer MASTER_KEY'
sorting_guide_update_sortable_attributes_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/books/settings/sortable-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "author",
      "price"
    ]'
sorting_guide_update_ranking_rules_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/books/settings/ranking-rules' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "words",
      "sort",
      "typo",
      "proximity",
      "attributeRank",
      "wordPosition",
      "exactness"
    ]'
sorting_guide_sort_nested_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/books/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "science fiction",
      "sort": ["rating.users:asc"]
    }'
sorting_guide_sort_parameter_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/books/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "science fiction",
      "sort": ["price:asc"]
    }'
sorting_guide_sort_parameter_2: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/books/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "butler",
      "sort": ["author:desc"]
    }'
geosearch_guide_filter_settings_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/restaurants/settings/filterable-attributes' \
    -H 'Content-type:application/json' \
    --data-binary '["_geo"]'
geosearch_guide_filter_settings_2: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/neighborhoods/settings/filterable-attributes' \
    -H 'Content-type:application/json' \
    --data-binary '["_geojson"]'
geosearch_guide_filter_usage_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/restaurants/search' \
    -H 'Content-type:application/json' \
    --data-binary '{ "filter": "_geoRadius(45.472735, 9.184019, 2000)" }'
geosearch_guide_filter_usage_2: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/restaurants/search' \
    -H 'Content-type:application/json' \
    --data-binary '{ "filter": "_geoRadius(45.472735, 9.184019, 2000) AND type = pizza" }'
geosearch_guide_filter_usage_3: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/restaurants/search' \
    -H 'Content-type:application/json' \
    --data-binary '{ "filter": "_geoBoundingBox([45.494181, 9.214024], [45.449484, 9.179175])" }'
geosearch_guide_sort_settings_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/restaurants/settings/sortable-attributes' \
    -H 'Content-type:application/json' \
    --data-binary '["_geo"]'
geosearch_guide_sort_usage_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/restaurants/search' \
    -H 'Content-type:application/json' \
    --data-binary '{ "sort": ["_geoPoint(48.8561446,2.2978204):asc"] }'
geosearch_guide_sort_usage_2: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/restaurants/search' \
    -H 'Content-type:application/json' \
    --data-binary '{
      "sort": [
        "_geoPoint(48.8561446,2.2978204):asc",
        "rating:desc"
      ]
    }'
basic_security_tutorial_admin_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer DEFAULT_ADMIN_API_KEY' \
    --data-binary '{
      "uid": "medical_records",
      "primaryKey": "id"
    }'
basic_security_tutorial_search_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/medical_records/search' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
    --data-binary '{ "q": "appointments" }'
primary_field_guide_create_index_primary_key: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "uid": "books",
      "primaryKey": "reference_number"
    }'
primary_field_guide_add_document_primary_key: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/books/documents?primaryKey=reference_number' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      {
        "reference_number": 287947,
        "title": "Diary of a Wimpy Kid",
        "author": "Jeff Kinney",
        "genres": [
          "comedy",
          "humor"
        ],
        "price": 5.00
      }
    ]'
primary_field_guide_update_document_primary_key: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/books' \
    -H 'Content-Type: application/json' \
    --data-binary '{ "primaryKey": "title" }'
tenant_token_guide_search_no_sdk_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/patient_medical_records/search' \
    -H 'Authorization: Bearer TENANT_TOKEN'
typo_tolerance_guide_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/movies/settings/typo-tolerance' \
    -H 'Content-Type: application/json' \
    --data-binary '{ "enabled": false }'
typo_tolerance_guide_2: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/movies/settings/typo-tolerance' \
    -H 'Content-Type: application/json' \
    --data-binary '{ "disableOnAttributes": ["title"] }'
typo_tolerance_guide_3: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/movies/settings/typo-tolerance' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "disableOnWords": [
        "shrek"
      ]
    }'
typo_tolerance_guide_4: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/movies/settings/typo-tolerance' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "minWordSizeForTypos": {
        "oneTypo": 4,
        "twoTypos": 10
      }
    }'
updating_guide_check_version_new_authorization_header: |-
  curl \
    -X GET 'http://<your-domain-name>/version' \
    -H 'Authorization: Bearer API_KEY'
updating_guide_create_dump: |-
  curl \
    -X POST 'http://<your-domain-name>/dumps' \
    -H 'Authorization: Bearer API_KEY'
synonyms_guide_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movies/settings/synonyms' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "great": ["fantastic"], "fantastic": ["great"]
    }'
date_guide_index_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/games/documents' \
    -H 'Content-Type: application/json' \
    --data-binary @games.json
date_guide_filterable_attributes_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/games/settings/filterable-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "release_timestamp"
    ]'
date_guide_filter_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/games/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "",
      "filter": "release_timestamp >= 1514761200 AND release_timestamp < 1672527600"
    }'
date_guide_sortable_attributes_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/games/settings/sortable-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "release_timestamp"
    ]'
date_guide_sort_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/games/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "",
      "sort": ["release_timestamp:desc"]
    }'
async_guide_filter_by_statuses_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/tasks?statuses=failed'
async_guide_filter_by_statuses_2: |-
  curl \
    -X GET 'MEILISEARCH_URL/tasks?statuses=failed,canceled'
async_guide_multiple_filters_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/tasks?indexUids=movies&types=documentAdditionOrUpdate,documentDeletion&statuses=processing'
faceted_search_update_settings_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/books/settings/filterable-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "genres", "rating", "language"
    ]'
faceted_search_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/books/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "classic",
      "facets": [
      "genres", "rating", "language"
    ]
  }'
filtering_update_settings_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/movie_ratings/settings/filterable-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "genres",
      "director",
      "release_date",
      "ratings"
    ]'
facet_search_2: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/books/settings/faceting' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "sortFacetValuesBy": {
        "genres": "count"
    }
  }'
facet_search_3: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/books/facet-search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "facetQuery": "c",
      "facetName": "genres"
  }'
facet_search_exhaustive_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/books/facet-search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "facetName": "genres",
      "facetQuery": "c",
      "exhaustiveFacetCount": true
    }'
analytics_event_click_1: |-
  curl \
    -X POST 'https://PROJECT_URL/events' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
    --data-binary '{
      "eventType": "click",
      "eventName": "Search Result Clicked",
      "indexUid": "products",
      "userId": "SEARCH_USER_ID",
      "queryUid": "019a01b7-a1c2-7782-a410-bb1274c81393",
      "objectId": "0",
      "objectName": "DOCUMENT_DESCRIPTION",
      "position": 0
    }'
analytics_event_conversion_1: |-
  curl \
    -X POST 'https://PROJECT_URL/events' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
    --data-binary '{
      "eventType": "conversion",
      "eventName": "Product Added To Cart",
      "indexUid": "products",
      "userId": "SEARCH_USER_ID",
      "objectId": "0",
      "objectName": "DOCUMENT_DESCRIPTION",
      "position": 0
    }'
analytics_event_bind_search_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
    -H 'X-MS-USER-ID: MEILISEARCH_USER_ID' \
    --data-binary '{}'
analytics_event_bind_event_1: |-
  curl \
    -X POST 'https://PROJECT_URL/events' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
    -H 'X-MS-USER-ID: SEARCH_USER_ID' \
    --data-binary '{
      "eventType": "click",
      "eventName": "Search Result Clicked",
      "indexUid": "products",
      "objectId": "0",
      "position": 0
    }'
analytics_exclude_search_requests: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search?analytics=false' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
    -H 'X-MS-USER-ID: MEILISEARCH_USER_ID' \
    --data-binary '{}'
distinct_attribute_guide_filterable_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/products/settings/filterable-attributes' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      "product_id",
      "sku",
      "url"
    ]'
distinct_attribute_guide_distinct_parameter_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/products/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "white shirt",
      "distinct": "sku"
    }'
search_parameter_guide_vector_1: |-
  curl -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "vector": [0, 1, 2],
      "hybrid": {
        "embedder": "EMBEDDER_NAME"
      }
    }'
# post_render_template
post_render_template_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/render-template' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "template": {
        "kind": "inlineDocumentTemplate",
        "inline": "An inline document template rendered on {{doc.id}}"
      },
      "input": {
        "kind": "inlineDocument",
        "inline": { "id": "this document" }
      }
    }'
render_template_guide_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/render-template' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "template": {
        "kind": "inlineDocumentTemplate",
        "inline": "A movie called {{doc.title}} whose description starts with: {{doc.overview|truncatewords:10}}"
      },
      "input": {
        "kind": "indexDocument",
        "indexUid": "movies",
        "id": "2"
      }
    }'
render_template_guide_2: |-
  curl \
    -X POST 'MEILISEARCH_URL/render-template' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "template": {
        "kind": "documentTemplate",
        "indexUid": "movies",
        "embedder": "OpenAI"
      },
      "input": {
        "kind": "inlineDocument",
        "inline": {
          "id": "some new docid",
          "title": "My New Movie",
          "overview": "A nice overview for my new movie"
        }
      }
    }'
render_template_guide_3: |-
  curl \
    -X POST 'MEILISEARCH_URL/render-template' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "template": {
        "kind": "inlineDocumentTemplate",
        "inline": "A buggy template that refers to an unavailable field: {{doc.doesnotexist}}"
      },
      "input": {
        "kind": "indexDocument",
        "indexUid": "movies",
        "id": "2"
      }
    }'
# post_indexes_indexUid_fields
list_index_fields_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/fields' \
    -H 'Content-Type: application/json'
update_experimental_features_contains_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/experimental-features/' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "containsFilter": true
    }'
update_experimental_features_multimodal_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/experimental-features/' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "multimodal": true
    }'
ai_search_user_embeddings_documents_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/documents' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      { "id": 0, "_vectors": { "EMBEDDER_NAME": [0, 0.8, -0.2]}, "text": "frying pan" },
      { "id": 1, "_vectors": { "EMBEDDER_NAME": [1, -0.2, 0]}, "text": "baking dish" }
    ]'
ai_search_user_embeddings_search_vector_filter_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "vector": [0, 1, 2],
      "filter": "price < 10",
      "sort": ["price:asc"],
      "hybrid": {
        "embedder": "EMBEDDER_NAME"
      }
    }'
user_provided_embeddings_settings_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/INDEX_NAME/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "embedders": {
        "EMBEDDER_NAME": {
          "source": "userProvided",
          "dimensions": MODEL_DIMENSIONS
        }
      }
    }'
image_search_user_embeddings_search_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "vector": VECTORIZED_QUERY,
      "hybrid": { "embedder": "EMBEDDER_NAME" }
    }'
image_search_user_embeddings_search_q_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "vector": VECTORIZED_QUERY,
      "hybrid": { "embedder": "EMBEDDER_NAME" },
      "q": "QUERY"
    }'
federated_search_multi_search_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/multi-search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "federation": {},
      "queries": [
        {
          "indexUid": "chats",
          "q": "natasha"
        },
        {
          "indexUid": "profiles",
          "q": "natasha"
        },
        {
          "indexUid": "tickets",
          "q": "natasha"
        }
      ]
    }'
federated_search_multi_search_weight_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/multi-search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "federation": {},
      "queries": [
        {
          "indexUid": "chats",
          "q": "rotondo"
        },
        {
          "indexUid": "profiles",
          "q": "rotondo",
          "federationOptions": { "weight": 1.2 }
        },
        {
          "indexUid": "tickets",
          "q": "rotondo"
        }
      ]
    }'
# get_chats
list_chat_workspaces_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/chats'
# get_chats_workspaceUid
get_chat_workspace_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/chats/WORKSPACE_NAME'
# delete_chats_workspaceUid
delete_chat_workspace_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/chats/WORKSPACE_NAME'
# post_chats_workspaceUid_chat_completions
post_chat_completion_1: |-
  curl -N \
    -X POST 'MEILISEARCH_URL/chats/WORKSPACE_NAME/chat/completions' \
    -H 'Authorization: Bearer MEILISEARCH_KEY' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "model": "PROVIDER_MODEL_UID",
      "messages": [
        {
          "role": "user",
          "content": "USER_PROMPT"
        }
      ],
      "tools": [
        {
          "type": "function",
          "function": {
            "name": "_meiliSearchProgress",
            "description": "Reports real-time search progress to the user"
          }
        },
        {
          "type": "function",
          "function": {
            "name": "_meiliSearchSources",
            "description": "Provides sources and references for the information"
          }
        }
      ]
    }'
# get_chats_workspaceUid_settings
chat_get_settings_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
    -H "Authorization: Bearer MEILISEARCH_KEY"
# patch_chats_workspaceUid_settings
chat_patch_settings_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
    -H "Authorization: Bearer MEILISEARCH_KEY" \
    -H "Content-Type: application/json" \
    --data-binary '{ "apiKey": "your-valid-api-key" }'
chat_patch_settings_prompts_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
    -H 'Authorization: Bearer MEILISEARCH_KEY' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "prompts": {
        "searchDescription": "Search the outdoor gear catalog whenever the user asks about products, prices, availability, or specifications. Do not use it for generic small talk.",
        "searchQParam": "A short natural-language query capturing the user intent. Rewrite long questions into 3 to 8 keywords. Preserve product names and brand names verbatim.",
        "searchIndexUidParam": "Choose between: \"products\" for physical gear, accessories, and apparel; \"guides\" for how-to articles and buying guides; \"reviews\" for customer reviews and ratings. Use \"products\" by default."
      }
    }'
# delete_chats_workspaceUid_settings
reset_chat_workspace_settings_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/chats/WORKSPACE_NAME/settings' \
    -H "Authorization: Bearer MEILISEARCH_KEY"
# post_dynamic_search_rules
list_dynamic_search_rules_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/dynamic-search-rules' \
    -H 'Content-Type: application/json'
# get_dynamic_search_rules_uid
get_dynamic_search_rule_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/dynamic-search-rules/black-friday'
# patch_dynamic_search_rules_uid
patch_dynamic_search_rule_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/dynamic-search-rules/black-friday' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "description": "Black Friday 2025 rules",
      "precedence": 10,
      "active": true,
      "conditions": {
        "query": {
          "isEmpty": true
        },
        "time": {
          "start": "2025-11-28T00:00:00Z",
          "end": "2025-11-28T23:59:59Z"
        }
      },
      "actions": [
        {
          "selector": { "indexUid": "products", "id": "123" },
          "action": { "type": "pin", "position": 1 }
        }
      ]
    }'
# delete_dynamic_search_rules_uid
delete_dynamic_search_rule_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/dynamic-search-rules/black-friday'
# get_indexes_indexUid_settings_foreign_keys
get_foreign_keys_setting_1: |-
  curl \
    -X GET 'MEILISEARCH_URL/indexes/books/settings/foreign-keys'
# put_indexes_indexUid_settings_foreign_keys
update_foreign_keys_setting_1: |-
  curl \
    -X PUT 'MEILISEARCH_URL/indexes/books/settings/foreign-keys' \
    -H 'Content-Type: application/json' \
    --data-binary '[
      {
        "foreignIndexUid": "authors",
        "fieldName": "author"
      },
      {
        "foreignIndexUid": "authors",
        "fieldName": "related_authors"
      }
    ]'
# delete_indexes_indexUid_settings_foreign_keys
reset_foreign_keys_setting_1: |-
  curl \
    -X DELETE 'MEILISEARCH_URL/indexes/books/settings/foreign-keys'
# post_network_control
network_control_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/network/control' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "origin": {
        "remoteName": "ms-00",
        "taskUid": 42,
        "networkVersion": "0195e7a8-9c0d-7b3a-8f2e-123456789abc"
      },
      "message": {
        "type": "exportNoIndexForRemote",
        "remote": "ms-01"
      }
    }'
# post_tasks_compact
compact_task_queue_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/tasks/compact'
chat_create_key_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/keys' \
    -H 'Authorization: Bearer MEILISEARCH_KEY' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "name": "Chat API Key",
      "description": "API key for chat completions",
      "actions": ["search", "chatCompletions"],
      "indexes": ["*"],
      "expiresAt": null
    }'
image_search_multimodal_settings_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/INDEX_NAME/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "embedders": {
        "MULTIMODAL_EMBEDDER_NAME": {
          "source": "rest",
          "url": "https://api.voyageai.com/v1/multimodal-embeddings",
          "apiKey": "VOYAGE_API_KEY",
          "indexingFragments": {
            "TEXTUAL_FRAGMENT_NAME": {
              "value": {
                "content": [
                  {
                    "type": "text",
                    "text": "A document named {{doc.title}} described as {{doc.description}}"
                  }
                ]
              }
            },
            "IMAGE_FRAGMENT_NAME": {
              "value": {
                "content": [
                  {
                    "type": "image_url",
                    "image_url": "{{doc.poster_url}}"
                  }
                ]
              }
            }
          },
          "searchFragments": {
            "USER_TEXT_FRAGMENT": {
              "value": {
                "content": [
                  {
                    "type": "text",
                    "text": "{{q}}"
                  }
                ]
              }
            },
            "USER_SUBMITTED_IMAGE_FRAGMENT": {
              "value": {
                "content": [
                  {
                    "type": "image_base64",
                    "image_base64": "data:{{media.image.mime}};base64,{{media.image.data}}"
                  }
                ]
              }
            }
          },
          "request": {
            "inputs": ["{{fragment}}", "{{..}}"],
            "model": "voyage-multimodal-3"
          },
          "response": {
            "data": [
              { "embedding": "{{embedding}}" },
              "{{..}}"
            ]
          }
        }
      }
    }'
image_search_multimodal_search_text_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "a mountain sunset with snow",
      "hybrid": {
        "embedder": "MULTIMODAL_EMBEDDER_NAME"
      }
    }'
image_search_multimodal_search_image_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "media": {
        "image": {
          "mime": "image/jpeg",
          "data": "<BASE64_ENCODED_IMAGE>"
        }
      },
      "hybrid": {
        "embedder": "MULTIMODAL_EMBEDDER_NAME"
      }
    }'
ai_search_getting_started_embedders_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/kitchenware/settings/embedders' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "products-openai": {
        "source": "openAi",
        "apiKey": "OPEN_AI_API_KEY",
        "model": "text-embedding-3-small",
        "documentTemplate": "An object used in a kitchen named '\''{{doc.name}}'\''"
      }
    }'
ai_search_getting_started_search_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/kitchenware/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "kitchen utensils made of wood",
      "hybrid": {
        "embedder": "products-openai"
      }
    }'
personalization_search_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "wireless keyboard",
      "personalize": {
        "userContext": "The user prefers compact mechanical keyboards from Keychron or Logitech, with a mid-range budget and quiet keys for remote work."
      }
    }'
configure_rest_embedder_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/embedders' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "EMBEDDER_NAME": {
        "source": "rest",
        "url": "PROVIDER_URL",
        "request": {
          "model": "MODEL_NAME",
          "input": ["{{text}}", "{{..}}"]
        },
        "response": {
          "data": [
            { "embedding": "{{embedding}}" },
            "{{..}}"
          ]
        },
        "apiKey": "PROVIDER_API_KEY",
        "documentTemplate": "SHORT_AND_RELEVANT_DOCUMENT_TEMPLATE"
      }
    }'
joins_define_relationship_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/deals/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "foreignKeys": [
        {
          "fieldName": "company_id",
          "foreignIndexUid": "companies"
        }
      ],
      "filterableAttributes": [
        {
          "attributePatterns": ["company_id"],
          "features": {
            "facetSearch": false,
            "filter": {
              "equality": true,
              "comparison": false
            }
          }
        }
      ]
    }'
joins_one_to_one_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/users/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "foreignKeys": [
        {
          "fieldName": "profile_id",
          "foreignIndexUid": "profiles"
        }
      ],
      "filterableAttributes": [
        {
          "attributePatterns": ["profile_id"],
          "features": {
            "facetSearch": false,
            "filter": {
              "equality": true,
              "comparison": false
            }
          }
        }
      ]
    }'
joins_one_to_many_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/companies/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "foreignKeys": [
        {
          "fieldName": "employee_ids",
          "foreignIndexUid": "employees"
        }
      ],
      "filterableAttributes": [
        {
          "attributePatterns": ["employee_ids"],
          "features": {
            "facetSearch": false,
            "filter": {
              "equality": true,
              "comparison": false
            }
          }
        }
      ]
    }'
joins_many_to_many_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/films/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "foreignKeys": [
        {
          "fieldName": "actor_ids",
          "foreignIndexUid": "actors"
        }
      ],
      "filterableAttributes": [
        {
          "attributePatterns": ["actor_ids"],
          "features": {
            "facetSearch": false,
            "filter": {
              "equality": true,
              "comparison": false
            }
          }
        }
      ]
    }'
joins_self_reference_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/products/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "foreignKeys": [
        {
          "fieldName": "frequently_bought_with",
          "foreignIndexUid": "products"
        }
      ],
      "filterableAttributes": [
        {
          "attributePatterns": ["frequently_bought_with"],
          "features": {
            "facetSearch": false,
            "filter": {
              "equality": true,
              "comparison": false
            }
          }
        }
      ]
    }'
joins_multiple_relationships_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/deals/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "foreignKeys": [
        {
          "fieldName": "company_id",
          "foreignIndexUid": "companies"
        },
        {
          "fieldName": "owner_user_id",
          "foreignIndexUid": "users"
        }
      ],
      "filterableAttributes": [
        {
          "attributePatterns": ["company_id"],
          "features": {
            "facetSearch": false,
            "filter": {
              "equality": true,
              "comparison": false
            }
          }
        },
        {
          "attributePatterns": ["owner_user_id"],
          "features": {
            "facetSearch": false,
            "filter": {
              "equality": true,
              "comparison": false
            }
          }
        }
      ]
    }'
joins_update_relationship_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/deals/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "foreignKeys": [
        {
          "fieldName": "assigned_user_id",
          "foreignIndexUid": "users"
        }
      ],
      "filterableAttributes": [
        {
          "attributePatterns": ["assigned_user_id"],
          "features": {
            "facetSearch": false,
            "filter": {
              "equality": true,
              "comparison": false
            }
          }
        }
      ]
    }'
joins_remove_relationships_1: |-
  curl \
    -X PATCH 'MEILISEARCH_URL/indexes/deals/settings' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "foreignKeys": []
    }'
joins_delete_orphaned_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/deals/delete-by-filter' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "filter": "company_id = deleted_company_1 OR company_id = deleted_company_2"
    }'
joins_remove_orphaned_ids_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/films/documents/edit' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "function": "doc.actors = doc.actors.filter(|id| id != context.deleted_id)",
      "context": {
        "deleted_id": "actor_42"
      },
      "filter": "actors = actor_42"
    }'
foreign_filter_basic_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/deals/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "contract",
      "filter": "_foreign(company, industry = \"Technology\" AND founded_year >= 2000)"
    }'
foreign_filter_equality_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/deals/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "contract",
      "filter": "_foreign(company, id = \"company_42\")"
    }'
foreign_filter_multiple_equality_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/deals/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "",
      "filter": "_foreign(company, industry = \"Technology\" OR industry = \"Finance\")"
    }'
foreign_filter_range_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/deals/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "enterprise",
      "filter": "_foreign(company, founded_year >= 2000 AND founded_year <= 2020)"
    }'
foreign_filter_date_range_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/deals/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "",
      "filter": "_foreign(company, last_funding_date >= \"2023-01-01\")"
    }'
foreign_filter_multiple_conditions_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/deals/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "contract",
      "filter": "_foreign(company, (industry = \"Technology\" AND founded_year >= 2010) OR revenue > 1000000)"
    }'
foreign_filter_combined_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/deals/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "contract",
      "filter": "value >= 100000 AND _foreign(company, industry = \"Technology\")"
    }'
foreign_filter_array_or_logic_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/films/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "filter": "actors.country = \"France\" OR actors.age > 35"
    }'
foreign_filter_array_and_logic_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/films/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "filter": "_foreign(actors, country = \"France\" AND age > 35)"
    }'
foreign_filter_certifications_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/products/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "motor",
      "filter": "_foreign(certifications, (standard = \"ISO 9001\" OR standard = \"CE\") AND issued_year >= 2020)"
    }'
foreign_filter_tags_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/articles/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "cryptography",
      "filter": "_foreign(tags, name = \"security\" AND name = \"encryption\")"
    }'
foreign_filter_skills_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/employees/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "fullstack",
      "filter": "_foreign(skills, (language = \"Python\" AND proficiency = \"advanced\") OR (language = \"JavaScript\" AND proficiency = \"advanced\"))"
    }'
rbac_search_with_foreign_filter_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/documents/search' \
    -H 'Authorization: Bearer TENANT_TOKEN' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "roadmap",
      "filter": "_foreign(access, user = \"jeremy@meilisearch.com\" OR teams IN [\"product\", \"engineering\"])"
    }'
rbac_multi_level_1: |-
  curl \
    -X POST 'MEILISEARCH_URL/indexes/documents/search' \
    -H 'Content-Type: application/json' \
    --data-binary '{
      "q": "sensitive",
      "filter": "_foreign(access, (user = \"jeremy@meilisearch.com\" AND roles IN [\"editor\", \"owner\"]) OR (teams IN [\"product\", \"engineering\"] AND roles IN [\"editor\"]))"
    }'
