Skip to content

v1.3.0-rc.0 🦁

Pre-release
Pre-release
Compare
Choose a tag to compare
@gillian-meilisearch gillian-meilisearch released this 03 Jul 13:21
· 80 commits to release-v1.3.0 since this release
a0df4be

v1.3.0 release changelogs

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.


⚡ Supercharge your Meilisearch experience

Say goodbye to server deployment and manual updates with Meilisearch Cloud. 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 separately. 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

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",
    "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

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 in (#3834)

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

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 (#3789, #3861) @irevoire @dureuill
  • 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

Fixes 🐞

  • Fix matching results returned by the exactness ranking rules when there are hard separators present (#3824) @dureuill
  • Fixes an issue where searching for words without . doesn't match any string in the index (#151, #3778)
  • Fix an issue around incorrect deletion of documents when using the disableOnAttributes typo setting (#3819) @loiclec

Misc

❤️ Thanks again to our external contributors: