diff options
author | 6543 <m.huber@kithara.com> | 2024-03-09 02:39:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-09 01:39:27 +0000 |
commit | 7fdc0481538151d8a5ed3ec2a32639950f5d8ac6 (patch) | |
tree | ce93a89a4fde28a2ae063d95f302eea9d4d003fe /modules/indexer/code/internal/indexer.go | |
parent | baeb2511741aa70d24a48fd46db936b52be9d9dd (diff) | |
download | gitea-7fdc0481538151d8a5ed3ec2a32639950f5d8ac6.tar.gz gitea-7fdc0481538151d8a5ed3ec2a32639950f5d8ac6.zip |
Patch in exact search for meilisearch (#29671)
meilisearch does not have an search option to contorl fuzzynes per query
right now:
- https://github.com/meilisearch/meilisearch/issues/1192
- https://github.com/orgs/meilisearch/discussions/377
- https://github.com/meilisearch/meilisearch/discussions/1096
so we have to create a workaround by post-filter the search result in
gitea until this is addressed.
For future works I added an option in backend only atm, to enable
fuzzynes for issue indexer too.
And also refactored the code so the fuzzy option is equal in logic to
code indexer
---
*Sponsored by Kithara Software GmbH*
Diffstat (limited to 'modules/indexer/code/internal/indexer.go')
-rw-r--r-- | modules/indexer/code/internal/indexer.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/indexer/code/internal/indexer.go b/modules/indexer/code/internal/indexer.go index da3ac3623c..c92419deb2 100644 --- a/modules/indexer/code/internal/indexer.go +++ b/modules/indexer/code/internal/indexer.go @@ -16,7 +16,7 @@ type Indexer interface { internal.Indexer Index(ctx context.Context, repo *repo_model.Repository, sha string, changes *RepoChanges) error Delete(ctx context.Context, repoID int64) error - Search(ctx context.Context, repoIDs []int64, language, keyword string, page, pageSize int, isMatch bool) (int64, []*SearchResult, []*SearchResultLanguages, error) + Search(ctx context.Context, repoIDs []int64, language, keyword string, page, pageSize int, isFuzzy bool) (int64, []*SearchResult, []*SearchResultLanguages, error) } // NewDummyIndexer returns a dummy indexer @@ -38,6 +38,6 @@ func (d *dummyIndexer) Delete(ctx context.Context, repoID int64) error { return fmt.Errorf("indexer is not ready") } -func (d *dummyIndexer) Search(ctx context.Context, repoIDs []int64, language, keyword string, page, pageSize int, isMatch bool) (int64, []*SearchResult, []*SearchResultLanguages, error) { +func (d *dummyIndexer) Search(ctx context.Context, repoIDs []int64, language, keyword string, page, pageSize int, isFuzzy bool) (int64, []*SearchResult, []*SearchResultLanguages, error) { return 0, nil, nil, fmt.Errorf("indexer is not ready") } |