API/behavior changes

⚠️ Breaking changes

Always require embedder in semantic and similar search requests

Context:

The default embedder is the embedder that is used in search and similar requests when (resp.) hybrid.embedder and embedder were not passed.

Currently, the default embedder is implicitly designated in the following way:

  1. If there is only one embedder for an index, then the single embedder is always the default embedder.
  2. If there are multiple embedders defined for an index, then the default embedder is the embedder named "default".

Motivation:

The main motivation for modifying this behavior is the following:

  1. the behavior is implicit, and so can be surprising to users. After adding a second embedder, suddenly Meilisearch complains about not finding the "default" embedder.
  2. due to user-provided vectors (_vectors.<name-of-embedder>), it is difficult to rename an embedder, so changing the default embedder is difficult after the fact.

Change:

  1. When using the semantic or the hybrid search, hybrid.embedder is now a mandatory parameter in GET and POST /indexes/{:indexUid}/search
  2. embedder is now a mandatory parameter in GET and POST /indexes/{:indexUid}/similar

Examples:

POST /indexes/movies/search

{
  "q": "batman",
  "hybrid": {
    // 💥 Breaking change: this is now mandatory even if there is a single
    // declared embedder
    "embedder": "text"
  }
}

POST /indexes/movies/similar

{
  "id": 42,
  // 💥 Breaking change: this is now mandatory even if the embedder is 
  // called "default"
  "embedder": "default"
}

Rationale:

While this choice forces the user to communicate possibly trivial information (in the case where there is only one embedder, or there is an embedder called default), this change has the following advantages: