Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move content out of learn/experimental section #2979

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 65 additions & 44 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1215,40 +1215,6 @@ index_settings_tutorial_api_put_setting_1: |-
index_settings_tutorial_api_task_1: |-
curl \
-X GET 'http://localhost:7700/tasks/TASK_UID'
get_embedders_1: |-
curl \
-X GET 'http://localhost:7700/indexes/INDEX_NAME/settings/embedders'
update_embedders_1: |-
curl \
-X PATCH 'http://localhost:7700/indexes/INDEX_NAME/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"embedders": {
"default": {
"source": "openAi",
"apiKey": "anOpenAiApiKey",
"model": "text-embedding-3-small",
"documentTemplate": "A document titled '{{doc.title}}' whose description starts with {{doc.overview|truncatewords: 20}}"
}
}
}'
reset_embedders_1: |-
curl \
-X DELETE 'http://localhost:7700/indexes/INDEX_NAME/settings/embedders'
search_parameter_guide_hybrid_1: |-
curl -X POST 'localhost:7700/indexes/INDEX_NAME/search' \
-H 'content-type: application/json' \
--data-binary '{
"q": "kitchen utensils",
"hybrid": {
"semanticRatio": 0.9,
"embedder": "default"
}
}'
search_parameter_guide_vector_1: |-
curl -X POST 'localhost:7700/indexes/INDEX_NAME/search' \
-H 'content-type: application/json' \
--data-binary '{ "vector": [0, 1, 2] }'
get_search_cutoff_1: |-
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/search-cutoff-ms'
Expand Down Expand Up @@ -1314,16 +1280,6 @@ analytics_event_bind_event_1: |-
"objectId": "0",
"position": 0
}'
search_parameter_reference_retrieve_vectors_1: |-
curl -X POST 'localhost:7700/indexes/INDEX_NAME/search' \
-H 'content-type: application/json' \
--data-binary '{
"q": "kitchen utensils",
"retrieveVectors": true,
"hybrid": {
"embedder": "default"
}
}'
search_parameter_reference_distinct_1: |-
curl \
-X POST 'http://localhost:7700/indexes/INDEX_NAME/search' \
Expand Down Expand Up @@ -1391,3 +1347,68 @@ update_localized_attribute_settings_1: |-
reset_localized_attribute_settings_1: |-
curl \
-X DELETE 'http://localhost:7700/indexes/INDEX_NAME/settings/localized-attributes'
experimental_get_metrics_1: |-
curl \
-X GET 'http://localhost:7700/metrics'
experimental_post_logs_stderr_1: |-
curl \
-X POST http://localhost:7700/logs/stderr \
-H 'Content-Type: application/json' \
--data-binary '{
"target": "milli=trace,index_scheduler=info,actix_web=off"
}'
experimental_post_logs_stream_1: |-
curl \
-X POST http://localhost:7700/logs/stream \
-H 'Content-Type: application/json' \
--data-binary '{
"mode": "human",
"target": "index_scheduler=trace"
}'
experimental_delete_logs_stream_1: |-
curl \
-X DELETE http://localhost:7700/logs/stream
experimental_get_embedders_1: |-
curl \
-X GET 'http://localhost:7700/indexes/INDEX_NAME/settings/embedders'
experimental_update_embedders_1: |-
curl \
-X PATCH 'http://localhost:7700/indexes/INDEX_NAME/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"embedders": {
"default": {
"source": "openAi",
"apiKey": "anOpenAiApiKey",
"model": "text-embedding-3-small",
"documentTemplate": "A document titled '{{doc.title}}' whose description starts with {{doc.overview|truncatewords: 20}}"
}
}
}'
experimental_reset_embedders_1: |-
curl \
-X DELETE 'http://localhost:7700/indexes/INDEX_NAME/settings/embedders'
experimental_search_parameter_guide_hybrid_1: |-
curl -X POST 'localhost:7700/indexes/INDEX_NAME/search' \
-H 'content-type: application/json' \
--data-binary '{
"q": "kitchen utensils",
"hybrid": {
"semanticRatio": 0.9,
"embedder": "default"
}
}'
experimental_search_parameter_guide_vector_1: |-
curl -X POST 'localhost:7700/indexes/INDEX_NAME/search' \
-H 'content-type: application/json' \
--data-binary '{ "vector": [0, 1, 2] }'
experimental_search_parameter_reference_retrieve_vectors_1: |-
curl -X POST 'localhost:7700/indexes/INDEX_NAME/search' \
-H 'content-type: application/json' \
--data-binary '{
"q": "kitchen utensils",
"retrieveVectors": true,
"hybrid": {
"embedder": "default"
}
}'
40 changes: 40 additions & 0 deletions config/redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -498,5 +498,45 @@
"source": "/docs/learn/contributing/contributing_docs",
"destination": "/docs/learn/resources/contributing_docs",
"permanent": true
},
{
"source": "/docs/learn/experimental/overview",
"destination": "/docs/learn/resources/experimental_features_overview",
"permanent": true
},
{
"source": "/docs/learn/experimental/max_number_of_batched_tasks",
"destination": "/docs/learn/self_hosted/configure_meilisearch_at_launch",
"permanent": true
},
{
"source": "/docs/learn/experimental/metrics",
"destination": "/docs/reference/api/metrics",
"permanent": true
},
{
"source": "/docs/learn/experimental/reduce-indexing-memory-usage",
"destination": "/docs/learn/self_hosted/configure_meilisearch_at_launch",
"permanent": true
},
{
"source": "/docs/learn/experimental/log_customization",
"destination": "/docs/reference/api/logs",
"permanent": true
},
{
"source": "/docs/learn/experimental/vector_search",
"destination": "/docs/learn/ai_powered_search/getting_started_with_ai_search",
"permanent": true
},
{
"source": "/docs/learn/experimental/search_queue_size",
"destination": "/docs/learn/self_hosted/configure_meilisearch_at_launch",
"permanent": true
},
{
"source": "/docs/learn/experimental/replication_parameter",
"destination": "/docs/learn/self_hosted/configure_meilisearch_at_launch",
"permanent": true
}
]
55 changes: 15 additions & 40 deletions config/sidebar-learn.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
"label": "Getting started with AI-powered search",
"slug": "getting_started_with_ai_search"
},
{
"source": "learn/ai_powered_search/search_with_user_provided_embeddings.mdx",
"label": "Use AI-powered search with user-provided embeddings",
"slug": "search_with_user_provided_embeddings"
},
{
"source": "learn/ai_powered_search/deactivate_ai_powered_search.mdx",
"label": "Deactivate AI-powered search",
"slug": "deactivate_ai_powered_search"
},
{
"source": "learn/ai_powered_search/difference_full_text_ai_search.mdx",
"label": "Differences between full-text and AI-powered search",
Expand Down Expand Up @@ -412,6 +422,11 @@
"label": "Known limitations",
"slug": "known_limitations"
},
{
"source": "learn/resources/experimental_features_overview.mdx",
"label": "Experimental features overview",
"slug": "experimental_features_overview"
},
{
"source": "learn/resources/faq.mdx",
"label": "FAQ",
Expand Down Expand Up @@ -453,46 +468,6 @@
"title": "Experimental",
"slug": "experimental",
"routes": [
{
"source": "learn/experimental/overview.mdx",
"label": "Overview",
"slug": "overview"
},
{
"source": "learn/experimental/max_number_of_batched_tasks.mdx",
"label": "Limit number of batched tasks",
"slug": "max_number_of_batched_tasks"
},
{
"source": "learn/experimental/metrics.mdx",
"label": "Metrics",
"slug": "metrics"
},
{
"source": "learn/experimental/reduce-indexing-memory-usage.mdx",
"label": "Reduce indexing memory usage",
"slug": "reduce-indexing-memory-usage"
},
{
"source": "learn/experimental/log_customization.mdx",
"label": "Log customization",
"slug": "log_customization"
},
{
"source": "learn/experimental/vector_search.mdx",
"label": "Vector search",
"slug": "vector_search"
},
{
"source": "learn/experimental/replication_parameters.mdx",
"label": "Replication parameters",
"slug": "replication_parameters"
},
{
"source": "learn/experimental/search_queue_size.mdx",
"label": "Search queue size",
"slug": "search_queue_size"
}
]
}
]
10 changes: 10 additions & 0 deletions config/sidebar-reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@
"source": "reference/api/experimental_features.mdx",
"label": "Experimental features",
"slug": "experimental_features"
},
{
"source": "reference/api/metrics.mdx",
"label": "Metrics",
"slug": "metrics"
},
{
"source": "reference/api/logs.mdx",
"label": "Logs",
"slug": "logs"
}
]
},
Expand Down
33 changes: 33 additions & 0 deletions learn/ai_powered_search/deactivate_ai_powered_search.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Deactivate AI-powered search — Meilisearch documentation
description: This guide shows how to disable Meilisearch's AI-powered search.
---

# Deactivate vector search <NoticeTag type="experimental" label="experimental" />

This guide shows how to disable Meilisearch's AI-powered search.

## Remove embedder configuration

Manually remove all embedder configuration from your index:

<CodeSamples id="experimental_reset_embedders_1" />

<Capsule intent="danger">
If you don't remove all configured embedders, Meilisearch will continue auto-generating embeddings for you documents. This will happen even if `vectorStore` has been set to `false` and may lead to unexpected expenses when using OpenAI's paid tiers.
</Capsule>

## Disable the vector store

If using Meilisearch Cloud, navigate to your project overview and find "Experimental features", then uncheck the "Vector store" box.

Alternatively, use [the `/experimental` route](/reference/api/experimental_features?utm_campaign=vector-search&utm_source=docs&utm_medium=vector-search-guide):

```sh
curl \
-X PATCH 'http://localhost:7700/experimental-features/' \
-H 'Content-Type: application/json' \
--data-binary '{
"vectorStore": false
}'
```
2 changes: 1 addition & 1 deletion learn/ai_powered_search/getting_started_with_ai_search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ curl \

## Generate vector embeddings with OpenAI

Next, you must generate vector embeddings for all documents in your dataset. Embeddings are mathematical representations of the meanings of words and sentences in your documents. Meilisearch relies on external providers to generate these embeddings. Use OpenAI for this tutorial.
Next, you must generate vector embeddings for all documents in your dataset. Embeddings are mathematical representations of the meanings of words and sentences in your documents. Meilisearch relies on external providers to generate these embeddings. This tutorial uses an OpenAI embedder, but Meilisearch also supports embedders from HuggingFace, Ollama, and any embedder accessible via a RESTful API.

Use the `embedders` index setting of the [update `/settings` endpoint](/reference/api/settings?utm_campaign=vector-search&utm_source=docs&utm_medium=vector-search-guide) to configure a default [OpenAI](https://platform.openai.com/) embedder:

Expand Down
69 changes: 69 additions & 0 deletions learn/ai_powered_search/search_user_provided_embeddings.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: Use AI-powered search with user-provided embeddings — Meilisearch documentation
description: This guide shows how to perform AI-powered searches with user-generated embeddings instead of relying on a third-party tool.
---

# Use AI-powered search with user-provided embeddings <NoticeTag type="experimental" label="experimental" />

This guide shows how to perform AI-powered searches with user-generated embeddings instead of relying on a third-party tool.

## Requirements

- A Meilisearch project with AI-powered search activated

## Configure a custom embedder

Configure the `embedder` index setting, settings its source to `userProvided`:

```sh
curl \
-X PATCH 'http://localhost:7700/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"embedders": {
"image2text": {
"source": "userProvided",
"dimensions": 3
}
}
}'
```

## Add documents to Meilisearch

Next, use [the `/documents` endpoint](/reference/api/documents?utm_campaign=vector-search&utm_source=docs&utm_medium=vector-search-guide) to upload vectorized documents. Place vector data in your documents' `_vectors` field:

```sh
curl -X POST -H 'content-type: application/json' \
'localhost:7700/indexes/products/documents' \
--data-binary '[
{ "id": 0, "_vectors": {"image2text": [0, 0.8, -0.2]}, "text": "frying pan" },
{ "id": 1, "_vectors": {"image2text": [1, -0.2, 0]}, "text": "baking dish" }
]'
```

## Vector search with user-provided embeddings

When using a custom embedder, you must vectorize both your documents and user queries.

Once you have the query's vector, pass it to the `vector` search parameter to perform an AI-powered search:

```sh
curl -X POST -H 'content-type: application/json' \
'localhost:7700/indexes/products/search' \
--data-binary '{ "vector": [0, 1, 2] }'
```

`vector` must be an array of numbers indicating the search vector. You must generate these yourself when using vector search with user-provided embeddings.

`vector` can be used together with [other search parameters](/reference/api/search?utm_campaign=vector-search&utm_source=docs&utm_medium=vector-search-guide), including [`filter`](/reference/api/search#filter) and [`sort`](/reference/api/search#sort):

```sh
curl -X POST -H 'content-type: application/json' \
'localhost:7700/indexes/products/search' \
--data-binary '{
"vector": [0, 1, 2],
"filter": "price < 10",
"sort": ["price:asc"]
}'
```
Loading
Loading