[ https://issues.apache.org/jira/browse/SOLR-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503959 ]
Hoss Man commented on SOLR-243: ------------------------------- 1) i'm sorry, i transposed the lines in my mind when i was readingthe patch (you've made a private constructor public, not the otherway arround -- my mistake) 2) yes, you're using Config.findClass ... what yonik asked was if there was a particular reason not to use Config.newInstance(name) in the loadIndexReaderFactory ... there is a lot of duplicate code in that method (mainly exception handling) that Config.newInstance takes care of for you. 3) I think you're missing my point about indexDefaults and mainIndex ... it's not a matter of just picking one, it's making it work with both so that a factory can be specified in the defaults for use anytime an IndexReader is opened, or from mainIndex awhen the "main index" is opened. I just poked around and found that the relevant class is "SolrIndexConfig" ... my suggestion was that this be where the IndexReaderFactory hook be so that it works the same way. I'm sorry if you feel like you are jumping through a lot of hoops ... it's not my intention to be difficult, i'm just making comments on the patch and asking general questions (not specificly directed at your patch) about how Solr as a project can best support the topic of this issue (hooks to allow custom code to create custom index readers). If the patch you have works well for you that's great, but that doesn't mean it will work well for everyone, which is something committers have to keep that in mind ... making public API changes (including new config syntax and especially new plugin hooks) is a serious change to the project and has to be considered very carefully because we have to be able to support it for a very very long time. > Create a hook to allow custome code to create custome index readers > ------------------------------------------------------------------- > > Key: SOLR-243 > URL: https://issues.apache.org/jira/browse/SOLR-243 > Project: Solr > Issue Type: Improvement > Components: search > Affects Versions: 1.3 > Environment: Solr core > Reporter: John Wang > Fix For: 1.3 > > Attachments: indexReaderFactory.patch, indexReaderFactory.patch > > > I have a customized IndexReader and I want to write a Solr plugin to use my > derived IndexReader implementation. Currently IndexReader instantiation is > hard coded to be: > IndexReader.open(path) > It would be really useful if this is done thru a plugable factory that can be > configured, e.g. IndexReaderFactory > interface IndexReaderFactory{ > IndexReader newReader(String name,String path); > } > the default implementation would just return: IndexReader.open(path) > And in the newSearcher and getSearcher methods in SolrCore class can call the > current factory implementation to get the IndexReader instance and then build > the SolrIndexSearcher by passing in the reader. > It would be really nice to add this improvement soon (This seems to be a > trivial addition) as our project really depends on this. > Thanks > -John -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.