Skip to content

v1.8.0-rc.0 🪼

Pre-release
Pre-release
Compare
Choose a tag to compare
@curquiza curquiza released this 15 Apr 07:49
· 51 commits to release-v1.8.0 since this release
0661c86

⚠️ Since this is a release candidate (RC), we do NOT recommend using it in a production environment. Is something not working as expected? We welcome bug reports and feedback about new features.

Meilisearch v1.8 introduces new changes and optimizations related to the Hybrid search with the addition of new models and embedders like REST embedders and the Ollama model. This version also focuses on stability by adding more security around the search requests. Finally, we introduce the negative operator to exclude specific terms from a search query.

New features and improvements 🔥

Hybrid search improvements

Full description of hybrid search changes here.

🗣️ This is an experimental feature and we need your help to improve it! Share your thoughts and feedback on this GitHub discussion.

Done by @dureuill and @jakobklemm in #4456, #4537, #4509, #4548, #4549.

⚠️ Breaking changes of hybrid search usage

  • To ease the search answer speed and bandwidth, Meilisearch no longer returns the query vector in the search response. The vector field will not be displayed.
  • _semanticScore is no longer returned in the search response. The _rankingScore field has the same value as the _semanticScore, and should be used in its place. To get the _rankingScore value, add "showRankingScore": true to the search query.
  • When adding "showRankingScoreDetails": true to a semantic search query, the vector and its value are no longer displayed to improve the search speed and bandwidth use.

New embedders: generic REST embedder and Ollama model

New embedder sources have been added

  • ollama source
  • rest source

REST embedder

Meilisearch now supports any REST embedder. You can set them up with the following configuration:

"default": {
  "source": "rest", // 👈 Use the REST source
  "url": "http://localhost:12345/api/v1/embed",
  // ☝️ Mandatory, full URL to the embedding endpoint
  "apiKey": "187HFLDH97CNHN",
  // ☝️ optional, will be passed as Bearer in the Authorization header
  "dimensions": 512,
  // ☝️ optional, inferred with a dummy request if missing
  "documentTemplate": "blabla",
  "inputField": ["data", "text"],
  // ☝️ inject texts in data.text in the query
  // Optional, defaults to []
  "inputType": "text", // text or textArray
  // ☝️ inject a single text
  // Optional, defaults to text
  "query": {
    // A JSON object describing other fields to send in a query
    // for example
    "model": "name-of-your-model",
    "dimensions": 512
  },
  // ☝️ A JSON object describing other fields to send in a query
  // Optional, defaults to {}
  "pathToEmbeddings": ["data"],
  // ☝️ look at embeddings in "data" in the response
  // Optional, defaults to []
  "embeddingObject": ["embedding"]
  // ☝️ look at the embedding inside of "embedding"
  // Optional, defaults to []
}

Here is an example of setting OpenAI embedder with the rest source:

{
  "source": "rest",
  "apiKey": "<your-openai-api-key>",
  "dimensions": 1536,
  "url": "https://api.openai.com/v1/embeddings",
  "query": {
    "model": "text-embedding-ada-002"
  },
  "inputField": ["input"],
  "inputType": "textArray",
  "pathToEmbeddings": ["data"],
  "embeddingObject": ["embedding"]
}

Ollama model

Here is how to set up the Ollama model:

"default": {
  "source": "ollama", // 👈 Use the Ollama source
  "url": "http://localhost:11434/api/embeddings",
  // ☝️ optional, fetched from MEILI_OLLAMA_URL environment variable if missing
  "apiKey": "<foobarbaz>",
  // ☝️ optional
  "model": "nomic-embed-text",
  "documentTemplate": "blabla" // like for openAI and huggingFace sources
}

Expose the distribution shift setting

When setting an embedder, you can now set the distribution shift.

"default": {
  "source": "huggingFace", // supported for any source
  "model": "some/model",
  "distribution": {  // describes the natural distribution of results
    "mean": 0.7, // mean value
    "sigma": 0.3 // variance
  }
}

The “distribution shift” is an affine transformation applied to the _rankingScore of a semantic search result with the aim of making the comparison to the _rankingScore of a keyword search result more meaningful.

Other hybrid search improvements

  • Hide the API key in settings and task queue (#4533) @dureuill
  • Return the keyword search results even in case of a failure of the embedding (#4548) @dureuill
  • For hybrid or semantic search requests, add a semanticHitCount field at the top of the search response indicating the number of hits originating from the semantic search (#4548) @dureuill

Support negative keyword when searching

Search queries can now contain a negative keyword to exclude terms from the search. Use the - operator in front of a word or a phrase to make sure no document that contains those words are shown in the results.

  • -escape returns a placeholder search without any document contains the escape word.
  • -escape room returns only documents containing the room word but not the escape one.
  • -"on demand" returns a placeholder search but without any document containing the "on demand" phrase.

Done by @Kerollmops in #4535.

Search robustness improvements

Add a search cutoff

To avoid any crash and performance issues, Meilisearch now stops search requests lasting more than 150ms.

If you want to customize this value, you can update the searchCutoffMs settings (value in ms):

curl \
  -X PATCH 'http://localhost:7700/indexes/movies/settings' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "searchCutoffMs": 50
  }'

The default value of the searchCutoffMs setting is null and corresponds to 150ms.

Done by @irevoire in #4466.

Limit concurrent search requests

Meilisearch now limits the number of search requests waiting to be processed to avoid consuming an unbounded amount of RAM and crashing. So a queue of search requests waiting to be processed has been introduced.

👉 This change does NOT impact the search performance, but only the number of enqueued search requests to prevent from any security issues.

The default number of requests in the queue is 1000.

To change this limit, use the experimental CLI flag:

./meilisearch --experimental-search-queue-size 100

🗣️ This is an experimental flag and we need your help to improve it! Share your thoughts and feedback on this GitHub discussion.

Done by @irevoire in #4536

Other improvements

  • The sortFacetValuesBy setting now impacts the /facet-search route (#4476) @Kerollmops
  • Related to Prometheus experimental feature: add status code label to the HTTP request counter (#4373) @rohankmr414
  • Tokenizer improvements by bumping charabia to 0.8.8 (#4511) @6543
    • Support markdown formatted code blocks
    • Improve Korean segmentation to correctly use the context ID registered in the dictionary

Fixes 🐞

Misc

❤️ Thanks again to our external contributors: