[jira] Commented: (SOLR-243) Create a hook to allow custome code to create custome index readers

2007-12-07 Thread John Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549654
 ] 

John Wang commented on SOLR-243:


Thanks Kevin!
Please vote on this patch to have it committed.

-John




 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, 
 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.



[jira] Commented: (SOLR-243) Create a hook to allow custome code to create custome index readers

2007-12-07 Thread Kevin Osborn (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549609
 ] 

Kevin Osborn commented on SOLR-243:
---

We used this patch with great success. We have a custom multiindex reader. This 
patch allowed us to just plug in our changes without resorting to hack up the 
base Solr code.

 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, 
 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.



[jira] Commented: (SOLR-243) Create a hook to allow custome code to create custome index readers

2007-06-12 Thread Hoss Man (JIRA)

[ 
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.



[jira] Commented: (SOLR-243) Create a hook to allow custome code to create custome index readers

2007-06-11 Thread John Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503697
 ] 

John Wang commented on SOLR-243:


Are you looking at the right patch?

For 1) at least, they are public.

2) I am using  Config.findClass

3) I just picked one from your suggestions, mainIndex is fine.

I feel I am jumping through quite a few arbitrary hoops just to contribute to 
an open source project, and this is wrong and defeats the whole purpose of the 
idea of open source.

I think being more constructive and result oriented instead of being difficult 
and purist can benefit this project much more. 

 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.



[jira] Commented: (SOLR-243) Create a hook to allow custome code to create custome index readers

2007-05-30 Thread Yonik Seeley (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500219
 ] 

Yonik Seeley commented on SOLR-243:
---

Minor nit: is there a reason that IndexReaderFactory can't be a class instead 
of an interface?
It doesn't seem to be a likely candidate for multiple inheritance, and making 
it a class allows us to upgrade the interface in the future while providing a 
backward compatible default implementation for people who have already 
implemented it.


 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.



[jira] Commented: (SOLR-243) Create a hook to allow custome code to create custome index readers

2007-05-30 Thread John Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500261
 ] 

John Wang commented on SOLR-243:


Hi Yonik:

1) context in factory: I am not sure how the interface would look like, 
suggestions?

2) I catch the exception to default to the normal IndexReader.open mechanism.

3) I just picked it to be an interface, I think making it an abstract class is 
fine.

thanks

-John

 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.



[jira] Commented: (SOLR-243) Create a hook to allow custome code to create custome index readers

2007-05-30 Thread John Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500262
 ] 

John Wang commented on SOLR-243:


My motivation in doing this is to create a plugin into solr for my project:

www.browseengine.com
or
bobo-browse.sourceforge.net

which is a more extensive facetted search implementation. I need a special 
IndexReader to do the plugin.

Please take a look.

Thanks

-John


 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.



[jira] Commented: (SOLR-243) Create a hook to allow custome code to create custome index readers

2007-05-26 Thread John Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12499294
 ] 

John Wang commented on SOLR-243:


1) Sorry about this, my eclipse IDE showed 2 spaces. I will remember in the 
future.

2) Sorry about this one as well, I changed them from public to private to do 
some testing and forgot to change them back. I have no problem with them being 
public. 

3) That sounds good. I just picked a spot in solrConfig.xml

4) Sure.

5) I think that is a coding style, but I am not religious about it.

6) That is a great idea! I wanted to add this but wasn't sure how to do it.

7) Ok.

Thanks for the code review!

-John


 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


 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.



[jira] Commented: (SOLR-243) Create a hook to allow custome code to create custome index readers

2007-05-26 Thread Hoss Man (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12499369
 ] 

Hoss Man commented on SOLR-243:
---

regarding the IndexReaderFactory.DEFAULT, i have  ahard time viewing it as good 
coding style at all ..but then again i've never seen any literature arguming 
for or against the concept, so i'm not sure what the pros are.  My personal 
list of cons...
a) violates the API / impl abstraction; interfaces shouldn't have to know about 
any of their Impls
b) forces people who want to write their own impl to have the default class 
loaded at run time even if they don't use it.
c) can't be changed; static variables in interfaces are be final (even if they 
aren't declared final) and can give the false impression to people reading an 
API that they can change it to something else.

as far as #6 above (an init method)  SolrCore.parseListener is a good example 
of how to NamedList style initing (see the SolrEventListener API).  
IndexSchema.readTokenFilterFactory is a good example of the simpler Map style 
initing.

I saw an idea thrown around recently about making super interfaces for each of 
the two types of initialization so a lot of this code could be refactored away 
... but that probably won't happen soon, and when/if it does it will be a big 
undertaking that will clean up everything, so in the mean time a 
cut/paste/tweak approach would be the best way to proceed

 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


 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.