diff options
author | Brecht Van Lommel <brecht@blender.org> | 2023-11-29 16:00:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-29 23:00:59 +0800 |
commit | a7de14e49305d7e2664c900f3a99b77213dddb27 (patch) | |
tree | 29f57e4498620a469cfd323c13a2b43b27c81445 /modules | |
parent | b348424c64cb839f1a2dff8f14d4f99969ad2b5f (diff) | |
download | gitea-a7de14e49305d7e2664c900f3a99b77213dddb27.tar.gz gitea-a7de14e49305d7e2664c900f3a99b77213dddb27.zip |
Meilisearch: require all query terms to be matched (#28293)
Previously only the first term had to be matched. That default
Meilisearch behavior makes sense for e.g. some kind of autocomplete to
find and select a single result. But for filtering issues it means you
can't narrow down results by adding more terms.
This is also more consistent with other indexers and GitHub.
---
Reference:
https://www.meilisearch.com/docs/reference/api/search#matching-strategy
Diffstat (limited to 'modules')
-rw-r--r-- | modules/indexer/issues/meilisearch/meilisearch.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/indexer/issues/meilisearch/meilisearch.go b/modules/indexer/issues/meilisearch/meilisearch.go index 335395f2f6..ab8dcd0af4 100644 --- a/modules/indexer/issues/meilisearch/meilisearch.go +++ b/modules/indexer/issues/meilisearch/meilisearch.go @@ -211,10 +211,11 @@ func (b *Indexer) Search(ctx context.Context, options *internal.SearchOptions) ( skip, limit := indexer_internal.ParsePaginator(options.Paginator, maxTotalHits) searchRes, err := b.inner.Client.Index(b.inner.VersionedIndexName()).Search(options.Keyword, &meilisearch.SearchRequest{ - Filter: query.Statement(), - Limit: int64(limit), - Offset: int64(skip), - Sort: sortBy, + Filter: query.Statement(), + Limit: int64(limit), + Offset: int64(skip), + Sort: sortBy, + MatchingStrategy: "all", }) if err != nil { return nil, err |