Skip to content

Omitting Hybrid.Embedder selects "" not "default" #536

@yuku

Description

@yuku

Description

if request.Hybrid != nil {
hybrid := make(map[string]interface{}, 2)
hybrid["embedder"] = request.Hybrid.Embedder
hybrid["semanticRatio"] = request.Hybrid.SemanticRatio
params["hybrid"] = hybrid
}

Due to L152, "" will be send to the API if request.Hybrid.Embedder is "", which is the zero value of string type in Golang.

Should it be fixed as follows?

if request.Hybrid.Embedder != "" {
  hybrid["embedder"] = request.Hybrid.Embedder
}

Expected behavior

image

I expected that omitting Embedder selects the "default" embedder as document says.

Current behavior

The SDK sends "" to the server and it responds with the following error:

Cannot find embedder with name ``.
Code: invalid_embedder
Type: invalid_request
Link: https://docs.meilisearch.com/errors#invalid_embedder (path "POST /indexes/CatalogItems/search" with method "Search")

Environment (please complete the following information):

  • OS: Debian GNU/Linux
  • Meilisearch version: v0.18.1
  • meilisearch-go version: v0.26.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions