-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support elastic search for code search #10273
Conversation
It's ready to review. |
has conflicts |
Please also add new fields (language, indexed at, commit id) |
Codecov Report
@@ Coverage Diff @@
## master #10273 +/- ##
=========================================
Coverage ? 43.53%
=========================================
Files ? 588
Lines ? 82448
Branches ? 0
=========================================
Hits ? 35895
Misses ? 42100
Partials ? 4453
Continue to review full report at Codecov.
|
Merge seems to be broken |
Codecov Report
@@ Coverage Diff @@
## master #10273 +/- ##
==========================================
- Coverage 43.43% 43.29% -0.14%
==========================================
Files 645 646 +1
Lines 71345 71588 +243
==========================================
+ Hits 30988 30994 +6
- Misses 35340 35577 +237
Partials 5017 5017
Continue to review full report at Codecov.
|
We can use version number at the end of index name, for example |
fce7bc0
to
17f1837
Compare
@lafriks done. |
@6543 Done. |
@zeripath Done. |
🚀 |
🎉 |
Fix #6648 |
This PR adds new code search type: elastic search. For highlighter, it uses the default
Highlighter
because most code files are small files. We get the keyword location on the text by an index function. That maybe not very fast.Thanks @lafriks.
We use version number at the end of index name, for example
gitea_codes.v1
and for next version create index namedgitea_codes.v2
and use aliasgitea_codes
for indexing and searching index. Migrating data can also be easily done copying data over from previous index version.And this PR also missed to store index version to some place. It should not be stored to a file because we assume that there are more than one gitea instances here. Maybe we should store it to database but we need another PR to do that.