Meilisearch: require all query terms to be matched (#28293) (#28296)

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
(cherry picked from commit d2908b2794)
This commit is contained in:
Giteabot 2023-11-29 23:38:04 +08:00 committed by Earl Warren
parent 694f748f38
commit 13c0df40de
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -211,10 +211,11 @@ func (b *Indexer) Search(ctx context.Context, options *internal.SearchOptions) (
skip, limit := indexer_internal.ParsePaginator(options.Paginator, maxTotalHits) skip, limit := indexer_internal.ParsePaginator(options.Paginator, maxTotalHits)
searchRes, err := b.inner.Client.Index(b.inner.VersionedIndexName()).Search(options.Keyword, &meilisearch.SearchRequest{ searchRes, err := b.inner.Client.Index(b.inner.VersionedIndexName()).Search(options.Keyword, &meilisearch.SearchRequest{
Filter: query.Statement(), Filter: query.Statement(),
Limit: int64(limit), Limit: int64(limit),
Offset: int64(skip), Offset: int64(skip),
Sort: sortBy, Sort: sortBy,
MatchingStrategy: "all",
}) })
if err != nil { if err != nil {
return nil, err return nil, err