Quote:
interesting architecture :)
Thanks...? :)
Quote:
These examples should have what you need?
How to get a SearchIntegrator from the EntityManager:
https://github.com/hibernate/hibernate-search/blob/a5c71698f86d9c80106d6ad19d6e9808a1d1d8af/integrationtest/wildfly/src/test/java/org/hibernate/search/test/integration/jms/controller/RegistrationMdb.java#L32
How to apply the indexing work given the SearchIntegrator:
https://github.com/hibernate/hibernate-search/blob/9db0676b794707865be0022a164d3c391c8629d5/backends/jms/src/main/java/org/hibernate/search/backend/impl/jms/AbstractJMSHibernateSearchController.java#L64
Yup, the solution I found on SO is the same. I'm also using the AbstractJMSHibernateSearchController as a template to apply the indexing work. However, not everything is perfect. See below :)
I found the following solution : http://stackoverflow.com/questions/28206502/access-directory-in-hibernate-search-5/28232872#28232872
Code:
SearchIntegrator searchIntegrator = getSearchFactory().unwrap(SearchIntegrator.class );
DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) searchIntegrator.getIndexManager(indexName)
And it's working!
It's not the end of my problems, though :)
It seems like the applyWork method in my BackendQueueProcessor class is being called constantly, even though there are no changes introduced in the database / the index... Is there some kind of acknowledgment mechanism that I need to use to let it know that the messages have been sent and received?
Or is it possible that I'm creating an endless loop? Does the execution of
Code:
indexManager.performOperations(queue, null);
trigger another round of messages?
EDIT:
I'm pretty sure that's the case. I'm never really storing anything in the index because calling
Code:
indexManager.performOperations(queue, null);
just calls my own BackendQueueProcessor, which sends the packet to the central node, which sends it to the clients, and so on... In the client node receiver I would like to call the default lucene worker to store the changes in the local index. Is that possible?