-
-
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
Refactor and enhance issue indexer to support both searching, filtering and paging #26012
Merged
techknowlogick
merged 108 commits into
go-gitea:main
from
wolfogre:feature/enhance_issue_bleve_indexer
Jul 31, 2023
Merged
Refactor and enhance issue indexer to support both searching, filtering and paging #26012
techknowlogick
merged 108 commits into
go-gitea:main
from
wolfogre:feature/enhance_issue_bleve_indexer
Jul 31, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wxiaoguang
added
the
status/blocked
This PR cannot be merged yet, i.e. because it depends on another unmerged PR
label
Jul 28, 2023
techknowlogick
approved these changes
Jul 31, 2023
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.
ty :)
techknowlogick
added
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
and removed
status/blocked
This PR cannot be merged yet, i.e. because it depends on another unmerged PR
labels
Jul 31, 2023
GiteaBot
removed
the
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
label
Jul 31, 2023
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Jul 31, 2023
* upstream/main: (26 commits) Add 'Show on a map' button to Location in profile, fix layout (go-gitea#26214) Use shared template for webhook icons (go-gitea#26242) Reduce margins on user settings page, introduce `flex-container` (go-gitea#26046) Refactor and enhance issue indexer to support both searching, filtering and paging (go-gitea#26012) Show image size on view page (go-gitea#25884) Fix pull request check list is limited (go-gitea#26179) Fix API leaking Usermail if not logged in (go-gitea#25097) [skip ci] Updated licenses and gitignores Fix typo in metadata (go-gitea#26207) Update js and py dependencies (go-gitea#26243) De-emphasize issue sidebar buttons (go-gitea#26171) Don't autosize textarea in diff view (go-gitea#26233) Add `/public/assets` to `.ignore` (go-gitea#26232) Fix attachment clipboard copy on insecure origin (go-gitea#26224) Fix commit compare style (go-gitea#26209) Fix unable to display individual-level project (go-gitea#26198) Fix access check for org-level project (go-gitea#26182) Fixed incorrect locale references (go-gitea#26218) Use calendar icon for `Joined on...` in profiles (go-gitea#26215) Add changelog for 1.20.2 (go-gitea#26208) ...
silverwind
pushed a commit
that referenced
this pull request
Aug 15, 2023
related: #26012 ### Bugs 1. missing project filter on the issue page. https://github.com/go-gitea/gitea/blob/1e76a824bcd71acd59cdfb2c4547806bc34b3d86/modules/indexer/issues/dboptions.go#L11-L15 3. incorrect SQL condition: some issue does not belong to a project but exists on the project_issue table. https://github.com/go-gitea/gitea/blob/f5dbac9d36f1678b928bee04e85fbd045c725698/models/issues/issue_search.go#L233 ### Before: ![before](https://github.com/go-gitea/gitea/assets/50507092/1dcde39e-3e2f-4151-b2c6-4d67bf493c2f) ### After: ![after](https://github.com/go-gitea/gitea/assets/50507092/badfb81f-056d-4a2f-9838-1cba9c15768d) --------- Co-authored-by: Giteabot <teabot@gitea.io>
lunny
pushed a commit
that referenced
this pull request
Aug 16, 2023
Fix #26536 Follow #26012 Whatever the comment type is, always update the issue indexer. So the issue indexer will be updated when there is a change in Status, Assignee, Label, and so on. I added the logic for `NotifyUpdateComment`, but missed it for `NotifyCreateIssueComment` and `NotifyDeleteComment`.
This was referenced Aug 16, 2023
lunny
pushed a commit
that referenced
this pull request
Aug 16, 2023
CaiCandong
added a commit
to CaiCandong/gitea
that referenced
this pull request
Aug 17, 2023
related: go-gitea#26012 1. missing project filter on the issue page. https://github.com/go-gitea/gitea/blob/1e76a824bcd71acd59cdfb2c4547806bc34b3d86/modules/indexer/issues/dboptions.go#L11-L15 3. incorrect SQL condition: some issue does not belong to a project but exists on the project_issue table. https://github.com/go-gitea/gitea/blob/f5dbac9d36f1678b928bee04e85fbd045c725698/models/issues/issue_search.go#L233 ![before](https://github.com/go-gitea/gitea/assets/50507092/1dcde39e-3e2f-4151-b2c6-4d67bf493c2f) ![after](https://github.com/go-gitea/gitea/assets/50507092/badfb81f-056d-4a2f-9838-1cba9c15768d) --------- Co-authored-by: Giteabot <teabot@gitea.io>
KN4CK3R
pushed a commit
that referenced
this pull request
Aug 19, 2023
Backport #26490 related: #26012 1. missing project filter on the issue page. https://github.com/go-gitea/gitea/blob/1e76a824bcd71acd59cdfb2c4547806bc34b3d86/modules/indexer/issues/dboptions.go#L11-L15 2. incorrect SQL condition: some issue does not belong to a project but exists on the project_issue table. https://github.com/go-gitea/gitea/blob/f5dbac9d36f1678b928bee04e85fbd045c725698/models/issues/issue_search.go#L233 ![before](https://github.com/go-gitea/gitea/assets/50507092/1dcde39e-3e2f-4151-b2c6-4d67bf493c2f) ![after](https://github.com/go-gitea/gitea/assets/50507092/badfb81f-056d-4a2f-9838-1cba9c15768d)
techknowlogick
pushed a commit
that referenced
this pull request
Aug 23, 2023
This PR has multiple parts, and I didn't split them because it's not easy to test them separately since they are all about the dashboard page for issues. 1. Support counting issues via indexer to fix #26361 2. Fix repo selection so it also fixes #26653 3. Keep keywords in filter links. The first two are regressions of #26012. After: https://github.com/go-gitea/gitea/assets/9418365/71dfea7e-d9e2-42b6-851a-cc081435c946 Thanks to @CaiCandong for helping with some tests.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
size/XXL
Denotes a PR that changes 1000+ lines, ignoring generated files.
type/enhancement
An improvement of existing functionality
type/refactoring
Existing code has been cleaned up. There should be no new functionality.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #24662.
Replace #24822 and #25708 (although it has been merged)
Background
In the past, Gitea supported issue searching with a keyword and conditions in a less efficient way. It worked by searching for issues with the keyword and obtaining limited IDs (as it is heavy to get all) on the indexer (bleve/elasticsearch/meilisearch), and then querying with conditions on the database to find a subset of the found IDs. This is why the results could be incomplete.
To solve this issue, we need to store all fields that could be used as conditions in the indexer and support both keyword and additional conditions when searching with the indexer.
Major changes
IndexerData
to include all fields that could be used as filter conditions.Search(ctx context.Context, kw string, repoIDs []int64, limit, start int, state string)
toSearch(ctx context.Context, options *SearchOptions)
, so it supports more conditions now.issueIndexerQueue
. UseIndexerMetadata
instead ofIndexerData
in case the data has been updated while it is in the queue. This also reduces the storage size of the queue.SearchOptions
. Also, update the data versions.issues.SearchIssueIDsByKeyword
inmodels
to avoid confusion where is the entry point to search issues.