Hi,
I want to switch from a FSDirectoryProvider to RamDirectoryProvider.
So in my hibernate.properties I have :
Code:
hibernate.search.default.directory_provider=org.hibernate.search.store.RAMDirectoryProvider
The indexation works well. But I do not manage to search in the index. I would like to get results of searchs in the RamDirectory as an Hits object using org.apache.lucene.search.Searcher.
Here is the code I wrote for FSDirectoryProvider :
Code:
Searcher idxSearcher = new IndexSearcher("myindex");
Analyzer analyzer = new StandardAnalyzer();
QueryParser parser = new QueryParser("content",analyzer);
String search = "name:" + searchString + " OR type:" + searchString + " OR subtype:" + searchString;
Query query = parser.parse(search);
Hits out = idxSearcher.search(query);
But this code is no longer working with the RamDirectoryProvider. I get an java.io.IOException when initializing the IndexSearcher.
What do I have to do to use a RamDirectoryProvider instead of the FSDirectoryProvider?
Thanks for you help!