Skip to content

v1.3.0 🦁

Compare
Choose a tag to compare
@curquiza curquiza released this 31 Jul 08:24
5b0157c

Meilisearch v1.3.0 introduces vector search, visible ranking score details, and the possibility to define fields to search on at search time. It also now includes the ability to search within facet values and sort facet values by count.

🧰 All official Meilisearch integrations (including SDKs, clients, and other tools) are compatible with this Meilisearch release. Integration deployment happens between 4 to 48 hours after a new version becomes available.

Some SDKs might not include all new features—consult the project repository for detailed information. Is a feature you need missing from your chosen SDK? Create an issue letting us know you need it, or, for open-source karma points, open a PR implementing it (we'll love you for that ❤️).


⚡ Supercharge your Meilisearch experience

Say goodbye to server deployment and manual updates with Meilisearch Cloud. Get started with a 14-day free trial! No credit card required.



New features and improvements 🔥

Vector Search — Experimental

You can now use Meilisearch as a vector store. Meilisearch allows you to add vector embeddings generated by third-party software, and use embeddings when searching with the /search or /multi-search routes.

This experimental feature can be enabled via the HTTP API using v1.3.0's new /experimental-features endpoint.

curl \
  -X PATCH 'http://localhost:7700/experimental-features/' \
  -H 'Content-Type: application/json'  \
  --data-binary '{
    "vectorStore": true
  }'

Sending Vectorized Documents

For the first iteration of this feature you must compute the vectors using a third-party tool such as Hugging Face, Cohere, or OpenAI. Once that is done, include them in your documents using the _vectors field. Finally, send the documents with vector data to your instance. A single document may contain multiple vectors.

⚠️ Vector size must be the same across all documents in a dataset. If vector sizes are inconsistent, Meilisearch will return an error during document addition.

curl -X POST -H 'content-type: application/json' \
  'localhost:7700/indexes/songs/documents' \
  --data-binary '[
      { "id": 0, "_vectors": [0, 0.8, -0.2], "title": "Across The Universe" },
      { "id": 1, "_vectors": [1, -0.2, 0], "title": "All Things Must Pass" },
      { "id": 2, "_vectors": [[0.5, 3, 1], [-0.2, 4, 6]], "title": "And Your Bird Can Sing" }
  ]'

Query Meilisearch using Vectors

Use the new vector search parameter with the /search and /multi-search to search for documents with the nearest vector. You must compute the vector query with a third-party tool.

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

Similarity score

When you use vector search, returned documents include a _semanticScore field.

{
  "hits": [
    { "id": 0, "_vectors": [0, 0.8, -0.2], "title": "Across The Universe", "_semanticScore": 0.6754 },
    { "id": 1, "_vectors": [1, -0.2, 0], "title": "All Things Must Pass", "_semanticScore": 0.7546 },
    { "id": 2, "_vectors": [[0.5, 3, 1], [-0.2, 4, 6]], "title": "And Your Bird Can Sing", "_semanticScore": 0.78 }
  ],
  "query": "",
  "vector": [0, 1, 2],
  "processingTimeMs": 0,
  "limit": 20,
  "offset": 0,
  "estimatedTotalHits": 2
}

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

⚠️ Experimental features may be incompatible between Meilisearch versions.

Done by @Kerollmops in #3825 and #3948

Display ranking scores at search

Use the new showRankingScore search parameter to see the ranking scores for returned documents.

curl \
  -X POST 'http://localhost:7700/indexes/movies/search' \
  -H 'Content-Type: application/json' \
  --data-binary '{ "q": "Batman Returns", "showRankingScore": true }'

Each returned document will include a _rankingScore property displaying a score between 0 and 1. The higher the ranking score, the more relevant the document.

"_rankingScore": 0.8575757575757575,

Ranking score details — Experimental

View detailed scores per ranking rule for each document with the experimental showRankingScoreDetails search parameter.

curl \
  -X POST 'http://localhost:7700/indexes/movies/search' \
  -H 'Content-Type: application/json' \
  --data-binary '{ "q": "Batman Returns", "showRankingScoreDetails": true }'

When showRankingScoreDetails is set to true, returned documents include a _rankingScoreDetails field. This field contains score values for each ranking rule.

"_rankingScoreDetails": {
  "words": {
    "order": 0,
    "matchingWords": 1,
    "maxMatchingWords": 1,
    "score": 1.0
  },
  "typo": {
    "order": 1,
    "typoCount": 0,
    "maxTypoCount": 1,
    "score": 1.0
  },
  "proximity": {
    "order": 2,
    "score": 1.0
  },
  "attribute": {
    "order": 3,
    "attributes_ranking_order": 0.8,
    "attributes_query_word_order": 0.6363636363636364,
    "score": 0.7272727272727273
  },
  "exactness": {
    "order": 4,
    "matchType": "noExactMatch",
    "matchingWords": 0,
    "maxMatchingWords": 1,
    "score": 0.3333333333333333
  }
}

This experimental feature can be turned on via the HTTP API using v1.3.0's new /experimental-features endpoint.

 curl \
  -X PATCH 'http://localhost:7700/experimental-features/' \
  -H 'Content-Type: application/json'  \
  --data-binary '{
    "scoreDetails": true
  }'

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

⚠️ Experimental features may be incompatible between Meilisearch versions.

Relevancy change on attribute ranking rule

The attribute ranking rule now determines relevancy based on the distance to the position of the word in the query rather than the absolute distance to the beginning of a document.

Previously, documents with attributes containing search terms at the beginning of the attribute would be considered more relevant than documents containing search terms at the end of an attribute.

Done by @dureuill in #3771 and #3949

Define fields to search on at search time

attributesToSearchOn is a new search parameter accepting an array of strings indicating one or more document attributes. Queries using attributesToSearchOn will restrict the search to the indicated attributes.

Attributes passed to attributesToSearchOn must be in the searchable attributes list.

Given the following dataset:

{
  "id": 0,
  "name": "Our Wives Under the Sea",
  "genre": ["horror", "scifi"],
  "synopsis": "A woman returns to her wife transformed after a deep-sea adventure."
},
{
  "id": 1,
  "name": "A Strange and Stubborn Endurance",
  "genre": ["adventure"],
  "synopsis": "A man must overcome trauma and fight off a mysterious assassin."
}

And the following query:

{
  "q": "adventure",
  "attributesToSearchOn": ["genre"]
}

Meilisearch will only return document 1.

Both documents contain the term "adventure", but "attributesToSearchOn": ["genre"] instructs Meilisearch to only consider results found on the genre field.

Done by @ManyTheFish and @dureuill in (#3834, #3915)

Search for facet values

The new endpoint POST /indexes/{index}/facet-search allows you to search for facet values. Only fields defined as filterableAttributes will be facet-searchable.

Facet search supports prefix search and typo tolerance.

 curl \
  -X POST 'http://localhost:7700/indexes/movies/facet-search' \
  -H 'Content-Type: application/json'  \
  --data-binary '{
    "facetName": "genres",
    "facetQuery": "a"
  }'

Done by @Kerollmops in (#3699)

Sort facet values by count

Order facets by count using the sortFacetValuesBy property of the faceting index settings. This allows you to sort facet values in descending order by the number of matched documents containing that facet value.

It is possible to change this ordering for all facets using *:

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

Alternatively, it is possible to order a single facet by count, while other attributes follow alphanumeric ordering:

 curl \
  -X PATCH 'http://localhost:7700/indexes/movies/settings/faceting \
  -H 'Content-Type: application/json'  \
--data-binary '{
    "sortFacetValuesBy": {"*": "alpha", "genre": "count"}
  }'

Done by @Kerollmops in (#3612)

Language support improvements

  • Enhance Japanese word segmentation (#218) @mosuka
  • Enhance separator-based Tokenization (#215) @ManyTheFish
    • words containing _ are now properly segmented into several words
    • brackets {([])} are no longer considered as context separators for the proximity ranking rule

Done by @ManyTheFish, @mosuka in [#3866] and in Charabia v0.8.1

Display a total count of tasks on the /tasks/ route

The /tasks route now displays the total number of tasks in the task queue with a total property. It also displays the total number of tasks within a specific filter e.g. you can view the total number of successfully processed tasks with /tasks?statuses=succeeded. This detail gives insight into the progress of processed tasks over time.

Done by @Kerollmops in (#3889)

Other improvements

  • Improve the Prometheus /metrics experimental feature (#625). Provides metrics on the task queue such as the number of queued tasks and the number of processing tasks. Adds the real database size used by Meilisearch. Add "meilisearch" prefix to metrics. Exposes lastUpdate and isIndexing in /stats endpoint (#3789, #3861, #3851) @irevoire @dureuill @gentcys
  • Reduce index size (~15%) by removing an internal database (#3819) @loiclec
  • Add new /experimental-features endpoint to configure scoreDetails and vectorStore (#3850) @dureuill
  • Reduce deserialization time by using RoaringBitmap::deserialize_unchecked_from (#3788) @Kerollmops
  • Re-enable autobatching for addition and deletion tasks (#3670) @irevoire
  • Improve local search preview web interface and update mini-dashboard to version v0.2.11 (#3955) @bidoubiwa

Fixes 🐞

  • Fix matching results returned by the exactness ranking rules when there are hard separators present (#3824) @dureuill
  • Fix an issue where searching for words without . doesn't match any string in the index (#151, #3778)
  • Fix case-sensitive search result issues with camelCasing. For example, a search for dellonghi would previously not return a document with DeLonghi in it. This deactivates camel case segmentation that was introduced in v1.2.0 (#3921) @ManyTheFish
  • Fix an issue around incorrect deletion of documents when using the disableOnAttributes typo setting (#3819) @loiclec
  • Replace the atty dependency with the is-terminal due to security vulnerability (#3878) @Kerollmops
  • Fix a panic when sorting geo fields represented by strings (#3929) @Kerollmops
  • Fix performance issue on /stats by no longer computing total size of the update files folder (#3933) @Kerollmops
  • Security: use the new safe read-txn-no-tls heed feature (#3952) @Kerollmops
  • Fix an issue when querying number by updating Charabia (#3937) @ManyTheFish

Misc

❤️ Thanks again to our external contributors: