-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
feat: add index mechanism for extension #5121
Conversation
7367f2d
to
14deb2a
Compare
50a95d2
to
090e50d
Compare
api/src/main/java/run/halo/app/extension/index/AbstractIndexAttribute.java
Show resolved
Hide resolved
api/src/main/java/run/halo/app/extension/index/query/StringContains.java
Outdated
Show resolved
Hide resolved
application/src/main/java/run/halo/app/content/PostIndexInformer.java
Outdated
Show resolved
Hide resolved
application/src/main/java/run/halo/app/extension/ReactiveExtensionClientImpl.java
Outdated
Show resolved
Hide resolved
application/src/main/java/run/halo/app/extension/index/DefaultIndexer.java
Outdated
Show resolved
Hide resolved
application/src/main/java/run/halo/app/extension/index/IndexEntryImpl.java
Outdated
Show resolved
Hide resolved
application/src/main/java/run/halo/app/extension/index/IndexEntryImpl.java
Outdated
Show resolved
Hide resolved
application/src/main/java/run/halo/app/extension/index/IndexEntryImpl.java
Outdated
Show resolved
Hide resolved
application/src/test/java/run/halo/app/extension/index/IndexEntryImplTest.java
Outdated
Show resolved
Hide resolved
application/src/test/java/run/halo/app/extension/index/IndexEntryImplTest.java
Show resolved
Hide resolved
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.
目前似乎没有发现可以自定义 Indexer 的地方。
IMO,我们可以在构建索引之前任意添加 Indexer,无论是在 Halo Core 中还是在插件中。
目前自己添加 Indexer 的需求是什么呢?每个自定义模型添加 IndexSpec 后启动时就会构建索引并创建 Indexer,可以参考这个适配的 PR halo-sigs/plugin-moments#69 |
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.
/approve
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.
/lgtm
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang, ruibaby The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
/area core
/milestone 2.12.x
What this PR does / why we need it:
新增自定义模型索引机制
默认为所有的自定义模型都添加了以下索引:
how to test it?
可以正确在自动生成的 list APIs 使用 fieldSelector 来过滤
spec.slug
和排序,可以自己添加其他的 indexSpec 测试6. 测试唯一索引并添加重复数据,期望无法添加进去
Which issue(s) this PR fixes:
Fixes #5058
Does this PR introduce a user-facing change?