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 repo code search without setting up an indexer #29998
Conversation
bbd6790
to
666155e
Compare
What do do about the Fuzzy/Match box? Does this support both modes? |
How's the performance? I assume on big repos it will be slow, but not really an issue I suppose. |
Quite fast on my side. And it only reads the first 50 results to avoid consuming too much server resources. |
Maybe test on |
Then it is not this PR's scope .... for example: Slow merge with large repos #9642 , and there are many problems when working with large repositories. |
Please also update the documentations. |
Please elaborate which document needs to be updated. |
I think the documentation about repository indexer can be updated https://docs.gitea.com/administration/repo-indexer |
|
b7e8672
to
c784c1b
Compare
c784c1b
to
2a58473
Compare
var total int | ||
var searchResults []*code_indexer.Result | ||
var searchResultLanguages []*code_indexer.SearchResultLanguages | ||
if setting.Indexer.RepoIndexerEnabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to intigrate the git grep search as its own indexer and set it as default.
This way it is transparent for webUI or API what to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea how to do that clearly, and I am not a fan of adding a lot of "options".
If you have better ideas, free free to edit this PR directly or have some following PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that will help but is unrelated to the architecture idea of mine.
I try to create a pull request to your branch that would move acording to my proposal, so it can be checked out and tested etc ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect that there is no new option to be introduced.
To reviewers: since there are some |
#30043 is the last of these "merge conflict" PRs. |
Didn't we where in feature freze?!? |
Not sure it qualifies as a feature in the strict sense. It's more like an addition to an existing feature. |
In my gitea installation this does not work if the repository is in an organisation. It works fine for non-organisation repositories. For repo in an organisation I receive a 500 error page. Log line states: "2024-03-24 19:55:12 2024/03/24 19:55:12 ...s/web/repo/search.go:69:Search() [E] GrepSearch: unable to run git grep: signal: killed, stderr:" I am running with the latest gitea docker image from docker hub. |
Hmm ... no idea why it happens. On my side, "org repo" just works:
|
By using git's ability, end users (especially small instance users) do not need to enable the indexer, they could also benefit from the code searching feature.
Fix #29996