[PR #5363] [MERGED] Refactor issue indexer #17767

Closed
opened 2025-11-02 15:37:08 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/5363
Author: @lunny
Created: 11/20/2018
Status: Merged
Merged: 2/19/2019
Merged by: @techknowlogick

Base: masterHead: lunny/indexer_interface


📝 Commits (10+)

📊 Changes

22 files changed (+1045 additions, -116 deletions)

View changed files

📝 Gopkg.lock (+9 -0)
📝 models/issue.go (+16 -2)
📝 models/issue_comment.go (+2 -0)
📝 models/issue_indexer.go (+91 -75)
📝 models/issue_list.go (+13 -3)
📝 models/models.go (+0 -14)
📝 models/unit_tests.go (+4 -0)
modules/indexer/issues/bleve.go (+250 -0)
modules/indexer/issues/bleve_test.go (+88 -0)
modules/indexer/issues/indexer.go (+36 -0)
modules/indexer/issues/queue.go (+11 -0)
modules/indexer/issues/queue_channel.go (+56 -0)
modules/indexer/issues/queue_disk.go (+104 -0)
📝 modules/notification/indexer/indexer.go (+54 -8)
modules/setting/indexer.go (+55 -0)
📝 modules/setting/setting.go (+2 -9)
📝 routers/api/v1/repo/issue.go (+1 -2)
📝 routers/init.go (+3 -1)
📝 routers/repo/issue.go (+5 -2)
vendor/github.com/lunny/levelqueue/LICENSE (+19 -0)

...and 2 more files

📄 Description

This PR refactor issue indexer implementation and create two interface, one is Indexer another is Queue and provide BleveIndexer, ChannelQueuue and LevelQueue. And you can add new implementation after this PR merged.

This PR will keep the issue indexer compitable with lower Gitea version.

EDIT: This PR also fixed some bugs on indexing and added delete index when deleting a repository or future deleting a standalone issue or pull request.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/5363 **Author:** [@lunny](https://github.com/lunny) **Created:** 11/20/2018 **Status:** ✅ Merged **Merged:** 2/19/2019 **Merged by:** [@techknowlogick](https://github.com/techknowlogick) **Base:** `master` ← **Head:** `lunny/indexer_interface` --- ### 📝 Commits (10+) - [`a58eb76`](https://github.com/go-gitea/gitea/commit/a58eb76b6b6c0f98d0717f6a49dc3e3379923cae) refactor issue indexer - [`f62f402`](https://github.com/go-gitea/gitea/commit/f62f4029d7d799fe88b45e7a41b1be1022170941) improve bleve index - [`961318b`](https://github.com/go-gitea/gitea/commit/961318b6e415f63b9344cc170a7b13738a2e70e4) indxer queue will init according setting and fix some tests - [`b3b82c2`](https://github.com/go-gitea/gitea/commit/b3b82c2707c8f72c5a8d3b235f67f065e2d055cb) fix bug - [`e2fbf78`](https://github.com/go-gitea/gitea/commit/e2fbf785158158be7407ffc8bf5707c4149b8abe) fix vendors - [`a4ad4af`](https://github.com/go-gitea/gitea/commit/a4ad4af4826871267a2a686cd2ab6b8043bea0e1) add config for issue indexer type - [`37d9722`](https://github.com/go-gitea/gitea/commit/37d972227ca65b588468b80361a0c812c76e34f8) fix bugs on issue indexer - [`4ce8881`](https://github.com/go-gitea/gitea/commit/4ce88810175449e9e0a4a70056af23b37ed503ca) fix lint - [`881cd48`](https://github.com/go-gitea/gitea/commit/881cd486e553d9eaa388b879d21c01de2d38377f) refactor the for loop - [`4258f9d`](https://github.com/go-gitea/gitea/commit/4258f9d7b243d158879da706566e5320d1297a56) reduce function signature change ### 📊 Changes **22 files changed** (+1045 additions, -116 deletions) <details> <summary>View changed files</summary> 📝 `Gopkg.lock` (+9 -0) 📝 `models/issue.go` (+16 -2) 📝 `models/issue_comment.go` (+2 -0) 📝 `models/issue_indexer.go` (+91 -75) 📝 `models/issue_list.go` (+13 -3) 📝 `models/models.go` (+0 -14) 📝 `models/unit_tests.go` (+4 -0) ➕ `modules/indexer/issues/bleve.go` (+250 -0) ➕ `modules/indexer/issues/bleve_test.go` (+88 -0) ➕ `modules/indexer/issues/indexer.go` (+36 -0) ➕ `modules/indexer/issues/queue.go` (+11 -0) ➕ `modules/indexer/issues/queue_channel.go` (+56 -0) ➕ `modules/indexer/issues/queue_disk.go` (+104 -0) 📝 `modules/notification/indexer/indexer.go` (+54 -8) ➕ `modules/setting/indexer.go` (+55 -0) 📝 `modules/setting/setting.go` (+2 -9) 📝 `routers/api/v1/repo/issue.go` (+1 -2) 📝 `routers/init.go` (+3 -1) 📝 `routers/repo/issue.go` (+5 -2) ➕ `vendor/github.com/lunny/levelqueue/LICENSE` (+19 -0) _...and 2 more files_ </details> ### 📄 Description This PR refactor issue indexer implementation and create two interface, one is `Indexer` another is `Queue` and provide `BleveIndexer`, `ChannelQueuue` and `LevelQueue`. And you can add new implementation after this PR merged. This PR will keep the issue indexer compitable with lower Gitea version. EDIT: This PR also fixed some bugs on indexing and added delete index when deleting a repository or future deleting a standalone issue or pull request. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 15:37:08 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17767