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
HSEARCH-1383 Ability to disable automatic indexing programmatically at the session level / HSEARCH-168 Ability to disable automatic indexing programmatically at the application level #3462
Conversation
b431e14
to
f7222bc
Compare
So the idea of filtering inside the ORM event listener somewhat failed 🥲. Since we attach the listener to the session factory, it behaves more like an application filter rather than a session filter. |
f7222bc
to
dc5b9c0
Compare
It can work, but you need the listener to delegate those checks to something that's session-bound. I gave it some thought, and I think the best approach would be for you to pass the type context to I created a branch to show what I mean, feel free to take those commits in your own branch and adapt them as necessary: main...yrodiere:HSEARCH-1383 |
2ba5aa6
to
ff9c395
Compare
ff9c395
to
d82ae28
Compare
Hopefully, it is a tad bit better now 🙈 |
I don't think we do. I believe mapped superclasses can be interfaces, and that opens a whole can of worms due to multiple inheritance: what if a class extends two mapped "superinterfaces", one being included and the other being excluded? Better keep it simple, IMO. |
ohhh OK 🙈, then some changes are in order 😄 give me a moment 😃 |
9e45282
to
5149e59
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.
Thanks! Here are a few comments, finally. Sorry for the delay.
documentation/src/main/asciidoc/reference/indexing-automatic.asciidoc
Outdated
Show resolved
Hide resolved
documentation/src/main/asciidoc/reference/indexing-automatic.asciidoc
Outdated
Show resolved
Hide resolved
documentation/src/main/asciidoc/reference/indexing-automatic.asciidoc
Outdated
Show resolved
Hide resolved
documentation/src/main/asciidoc/reference/indexing-automatic.asciidoc
Outdated
Show resolved
Hide resolved
mapper/orm/src/main/java/org/hibernate/search/mapper/orm/Search.java
Outdated
Show resolved
Hide resolved
...nate/search/mapper/pojo/automaticindexing/filter/PojoAutomaticIndexingTypeFilterContext.java
Outdated
Show resolved
Hide resolved
...earch/integrationtest/mapper/orm/automaticindexing/ApplicationAutomaticIndexingFilterIT.java
Outdated
Show resolved
Hide resolved
...earch/integrationtest/mapper/orm/automaticindexing/ApplicationAutomaticIndexingFilterIT.java
Outdated
Show resolved
Hide resolved
...te/search/integrationtest/mapper/orm/automaticindexing/SessionAutomaticIndexingFilterIT.java
Outdated
Show resolved
Hide resolved
...te/search/integrationtest/mapper/orm/automaticindexing/SessionAutomaticIndexingFilterIT.java
Outdated
Show resolved
Hide resolved
bacb0e1
to
cc258ad
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.
Thanks, it's looking better but I would advise a few more adjustments. You might want to proof-read as well, as it seems some renamings were done only partially.
documentation/src/main/asciidoc/reference/indexing-automatic.asciidoc
Outdated
Show resolved
Hide resolved
documentation/src/main/asciidoc/reference/indexing-automatic.asciidoc
Outdated
Show resolved
Hide resolved
mapper/orm/src/main/java/org/hibernate/search/mapper/orm/Search.java
Outdated
Show resolved
Hide resolved
...ase/src/main/java/org/hibernate/search/mapper/pojo/work/SearchIndexingPlanFilterContext.java
Outdated
Show resolved
Hide resolved
...ase/src/main/java/org/hibernate/search/mapper/pojo/work/SearchIndexingPlanFilterContext.java
Outdated
Show resolved
Hide resolved
.../main/java/org/hibernate/search/mapper/pojo/work/spi/ConfiguredSearchIndexingPlanFilter.java
Show resolved
Hide resolved
.../main/java/org/hibernate/search/mapper/pojo/work/spi/ConfiguredSearchIndexingPlanFilter.java
Show resolved
Hide resolved
.../main/java/org/hibernate/search/mapper/pojo/work/spi/ConfiguredSearchIndexingPlanFilter.java
Outdated
Show resolved
Hide resolved
2e19e0d
to
8d2a975
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.
LGTM apart from two minor comments. Feel free to merge once they're addressed.
Thanks!
...ain/java/org/hibernate/search/mapper/pojo/work/impl/SearchIndexingPlanFilterContextImpl.java
Outdated
Show resolved
Hide resolved
mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/logging/impl/Log.java
Outdated
Show resolved
Hide resolved
8d2a975
to
3ca6420
Compare
...se/src/main/java/org/hibernate/search/mapper/pojo/mapping/impl/PojoTypeManagerContainer.java
Outdated
Show resolved
Hide resolved
...se/src/main/java/org/hibernate/search/mapper/pojo/mapping/impl/PojoTypeManagerContainer.java
Outdated
Show resolved
Hide resolved
...ain/java/org/hibernate/search/mapper/pojo/work/impl/SearchIndexingPlanFilterContextImpl.java
Outdated
Show resolved
Hide resolved
3ca6420
to
a11a7d0
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.
Thanks, LGTM, though I think I spotted an unnecessary check. Please have a look and then feel free to merge!
...ain/java/org/hibernate/search/mapper/pojo/work/impl/SearchIndexingPlanFilterContextImpl.java
Outdated
Show resolved
Hide resolved
...ain/java/org/hibernate/search/mapper/pojo/work/impl/SearchIndexingPlanFilterContextImpl.java
Outdated
Show resolved
Hide resolved
a11a7d0
to
765681e
Compare
Kudos, SonarCloud Quality Gate passed! |
Merged, thanks! |
Actually, not merged, GitHub is having problems... |
https://hibernate.atlassian.net/browse/HSEARCH-1383
https://hibernate.atlassian.net/browse/HSEARCH-168
The filter is applied in the process method for indexing the plan for this first iteration, and then there's also usage of it in the event listener to reduce the amount of work.