-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add detected file language to code search #10256
Add detected file language to code search #10256
Conversation
3604c57
to
6c02baf
Compare
Codecov Report
@@ Coverage Diff @@
## master #10256 +/- ##
=========================================
Coverage ? 43.75%
=========================================
Files ? 586
Lines ? 81113
Branches ? 0
=========================================
Hits ? 35491
Misses ? 41234
Partials ? 4388
Continue to review full report at Codecov.
|
I think a better UI is always list all the languages even you check one of the languages. And if you use one and hightlight one. Otherwise once you click the language, you cannot back to the previous UI or click another language. |
@lunny that's really not possible imho as bleve returns stats based on query in single request. Showing all languages would require execute separate search without language filter and would make things at least twice as slow |
Can you use the laguage stats table for a list of languagues? |
No, code language stats are for repository, search can be global and filters are shown per-file ocurrance count |
4f6ac41
to
d708a81
Compare
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 will not block this PR. But I think we still need that languages stat bar. We may need two requests. |
That can be improved later but it should be measured how much performance hit would it make |
Or we could add a button to return to all languages. i.e. |
@lafriks Maybe the language list can be actually asked to bleve itself? The indexer should know what languages are indexed at any given time, since it's metadata. |
@guillep2k language list is already returned by bleve using facets: https://github.com/go-gitea/gitea/pull/10256/files#diff-b34c4c9dfe1f4d61c3585819d795f655R352 To get language list for results for all languages would require doing separate request to bleve with other query without language condition just to get them |
b2e9115
to
ca5d728
Compare
@lunny @guillep2k ok, I added additional query to bleve to get language stats for query if filtering by language, see updates screenshot above |
ca5d728
to
bc2cd44
Compare
Pagination is not correct. |
@lunny I already fixed pagination today, or what do you mean? |
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.
When you select one language, I found there is still pagination problem.
@lunny what problem exactly? Works for me just fine both when language is selected and when not |
Perhaps if you're on page 2 of |
@guillep2k no, I specifically create url without page number when clicking on language to go to page one in such cases |
@lafriks when you click that language only one page. |
Move langauge detection to separate module to be more reusable Add option to disable vendored file exclusion from file search Allways show all language stats for search
03869df
to
8ade039
Compare
@lunny fixed, I introduced bug when adding language stats with separate bleve query :) |
Somehow the "Update Branch" button is not available ATM. I'm unable to update+merge. |
Ping LG-TM |
This is such a useful feature, I can't wait to upgrade to the 12 release! Big thank you to @lafriks and everyone else who contributed to this feature. Keep up the great work guys, |
There are multiple things improved in code search:
View file
would open actually indexed file versionScreenshot:
![image](https://user-images.githubusercontent.com/165205/74373146-8d7ec880-4de4-11ea-97c0-ba7223551488.png)
Selected language filter:
![image](https://user-images.githubusercontent.com/165205/74727021-24b2a880-5249-11ea-81e6-51a9ae99bf32.png)