0

This is extension of my earlier question.

I'm going to create custom request handler to provide terms association mining over existing index. In order to do this I need access to Solr's IndexReader opened on default index directory.

The only way to do this I can think of is to get IndexReaderFactory by invoking SolrQueryRequest.getCore().getIndexReaderFactory(). This factory has method newReader() which seems to be what I need. But this method requires index directory as its first argument.

Here's my question: is it correct way to get IndexReader? If so, how can I get Solr's index directory? Can I access Solr configuration to find it from my code or should I go with something else?

Community
  • 1
  • 1
ffriend
  • 27,562
  • 13
  • 91
  • 132

1 Answers1

2

I found an answer myself while reading LukeRequestHandler source:

SolrIndexSearcher searcher = req.getSearcher();
IndexReader reader = searcher.getReader();

So they first get searcher, and only then reader.

ffriend
  • 27,562
  • 13
  • 91
  • 132