We are currently using Hibernate Search 5.11.0 and trying to implement some kind of autocompleter for search requests.
To do that we are currently just opening the Lucene index directly with:
Directory dir = FSDirectory.open(...); Reader reader = DirectoryReader.open(dir); IndexSearcher searcher = new IndexSearcher(reader);
Later on we check sometimes if the reader needs to access the new version of the index (openIfChanged).
This works fine and we also think, that this works in parallel with the Hibernate Search write access to the index. (automatic indexing is on)
But we are not sure if this should work or is intended to be possible. Hibernate and our code run in the same vm. Only Hibernate has write access to the index but the index is still opened multiple times, which should not be possible?
Or does the the config exclusiv_index_use indent something else we are currently not aware of?
Can we maybe get access to the Hibernate Lucene Directory / IndexReader object? Here it is important to not open a connection to the database. Otherwise the feature just uses to much resources in our scenario.