You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Kevin A. Burton" <bu...@newsmonster.org> on 2004/03/31 00:59:27 UTC

[patch] MultiSearcher should support getSearchables()

Seems to only make sense to allow a caller to find the searchables a 
MultiSearcher was created with:

 > 'diff' -uN MultiSearcher.java.bak MultiSearcher.java
--- MultiSearcher.java.bak      2004-03-30 14:57:41.660109642 -0800
+++ MultiSearcher.java  2004-03-30 14:57:46.530330183 -0800
@@ -208,4 +208,8 @@
     return searchables[i].explain(query,doc-starts[i]); // dispatch to 
searcher
   }
 
+  public Searchable[] getSearchables() {
+    return searchables;
+  }
+
 }

-- 

Please reply using PGP.

    http://peerfear.org/pubkey.asc    
    
    NewsMonster - http://www.newsmonster.org/
    
Kevin A. Burton, Location - San Francisco, CA, Cell - 415.595.9965
       AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
  IRC - freenode.net #infoanarchy | #p2p-hackers | #newsmonster	


Re: [patch] MultiSearcher should support getSearchables()

Posted by "Kevin A. Burton" <bu...@newsmonster.org>.
Erik Hatcher wrote:

>
> No question that it'd be unwise to do.  We could say the same argument 
> for making everything public access as well and say it'd be stupid to 
> override this method, but we made it public anyway.  I'd rather opt on 
> the side of safety.
>
> Besides, you haven't provided a use case for why you need to get the 
> searchers back from a MultiSearcher :)
>
Just ease of use really... I have our MultiSearcher reload transparently 
and this case I can verify that I'm using the right array of searchers 
not one that's already been reloaded behind me.

I can add some code to preserve the original searcher array but it's a pain.

Kevin

-- 

Please reply using PGP.

    http://peerfear.org/pubkey.asc    
    
    NewsMonster - http://www.newsmonster.org/
    
Kevin A. Burton, Location - San Francisco, CA, Cell - 415.595.9965
       AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
  IRC - freenode.net #infoanarchy | #p2p-hackers | #newsmonster


Re: [patch] MultiSearcher should support getSearchables()

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Mar 30, 2004, at 8:52 PM, Kevin A. Burton wrote:
> Erik Hatcher wrote:
>
>> On Mar 30, 2004, at 5:59 PM, Kevin A. Burton wrote:
>>
>>> Seems to only make sense to allow a caller to find the searchables a 
>>> MultiSearcher was created with:
>>
>>
>> Could you elaborate on why it makes sense?  What if the caller 
>> changed a Searchable in the array?  Would anything bad happen?  (I 
>> don't know, haven't looked at the code).
>
> Yes... something bad could happen... but that would be amazingly 
> stupid ... we should probably recommend that it be readonly.

No question that it'd be unwise to do.  We could say the same argument 
for making everything public access as well and say it'd be stupid to 
override this method, but we made it public anyway.  I'd rather opt on 
the side of safety.

Besides, you haven't provided a use case for why you need to get the 
searchers back from a MultiSearcher :)

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: [patch] MultiSearcher should support getSearchables()

Posted by "Kevin A. Burton" <bu...@newsmonster.org>.
Erik Hatcher wrote:

> On Mar 30, 2004, at 5:59 PM, Kevin A. Burton wrote:
>
>> Seems to only make sense to allow a caller to find the searchables a 
>> MultiSearcher was created with:
>
>
> Could you elaborate on why it makes sense?  What if the caller changed 
> a Searchable in the array?  Would anything bad happen?  (I don't know, 
> haven't looked at the code).

Yes... something bad could happen... but that would be amazingly stupid 
... we should probably recommend that it be readonly.

Kevin

-- 

Please reply using PGP.

    http://peerfear.org/pubkey.asc    
    
    NewsMonster - http://www.newsmonster.org/
    
Kevin A. Burton, Location - San Francisco, CA, Cell - 415.595.9965
       AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
  IRC - freenode.net #infoanarchy | #p2p-hackers | #newsmonster


Re: [patch] MultiSearcher should support getSearchables()

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Mar 30, 2004, at 5:59 PM, Kevin A. Burton wrote:
> Seems to only make sense to allow a caller to find the searchables a 
> MultiSearcher was created with:

Could you elaborate on why it makes sense?  What if the caller changed 
a Searchable in the array?  Would anything bad happen?  (I don't know, 
haven't looked at the code).



>
> > 'diff' -uN MultiSearcher.java.bak MultiSearcher.java
> --- MultiSearcher.java.bak      2004-03-30 14:57:41.660109642 -0800
> +++ MultiSearcher.java  2004-03-30 14:57:46.530330183 -0800
> @@ -208,4 +208,8 @@
>     return searchables[i].explain(query,doc-starts[i]); // dispatch to 
> searcher
>   }
> +  public Searchable[] getSearchables() {
> +    return searchables;
> +  }
> +
> }
>
> -- 
>
> Please reply using PGP.
>
>    http://peerfear.org/pubkey.asc          NewsMonster - 
> http://www.newsmonster.org/
>    Kevin A. Burton, Location - San Francisco, CA, Cell - 415.595.9965
>       AIM/YIM - sfburtonator,  Web - http://peerfear.org/
> GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
>  IRC - freenode.net #infoanarchy | #p2p-hackers | #newsmonster	
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org