-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[hibernate-search] Cannot inject CDI bean in @SearchExtension
classes
#41384
Comments
hey @cthiebault |
Thanks @marko-bekhta! |
My bad! It works! When I wrote a simple app to reproduce this issue, it worked. Thanks @marko-bekhta for your quick anwers :-) |
No worries 😃, glad you figured it out. |
I don't know if I should open another issue, but when I run my application (
I read #37444 and tried to inject @ConfigProperty(name = "index-prefix")
Instance<Optional<String>> prefix; but it didn't work better :-( |
I believe the index layout strategy is used by Hibernate Search at static init, so you can't use runtime properties in there. I'd suggest opening a feature request to make the index layout strategy a runtime component (which makes sense) FWIW it'll probably require changes to Hibernate Search itself, since it currently creates index names very (too?) early, for no good reason that I can see (the names aren't used until runtime): https://github.com/hibernate/hibernate-search/blob/0b9e3f0d87250daa800f10223bcc81cdb0da773a/backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/impl/ElasticsearchBackendImpl.java#L206 |
Describe the bug
I would like to prefix the name of my indices with the name of the environment in which they are created.
The environment is defined in the
application.properties
file.I tried to implement
org.hibernate.search.backend.elasticsearch.index.layout.IndexLayoutStrategy
but I cannot inject the prefix: the injected
prefix
is always null.Expected behavior
I would expect to be able to inject CDI beans to
@SearchExtension
beansActual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
21.0.2
Quarkus version or git rev
3.11.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: