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 Vipin Rakkanath <vi...@qburst.com> on 2007/12/19 14:21:24 UTC

Issue with multiple index search

Hi folks,

I use to search within multiple indexes using  ParallelMultiSearcher.
All the indexes are remote. There are many index servers and each of
them contains multiple indexes.

While searching, I am getting exception when one of the indexes
has a problem. The exception is given.

I edited the following methods,

1.  MultiSearcher : public int docFreq(Term term) throws IOException
2.  ParallelMultiSearcher : TopDocs search

I deleted all problematic searchable objects from the list and did the
search again. Now its working ok.

Is this a feasible solution..?


please comment about this.




Thanks,

Vipin R



caught a class java.lang.NullPointerException with message: null Exception
in thread "main" java.lang.NullPointerException at
org.apache.lucene.index.TermInfosReader.ensureIndexIsRead(
TermInfosReader.java:100) at org.apache.lucene.index.TermInfosReader.get(
TermInfosReader.java:133) at org.apache.lucene.index.SegmentReader.docFreq (
SegmentReader.java:358) at org.apache.lucene.search.IndexSearcher.docFreq(
IndexSearcher.java:79) at org.apache.lucene.search.RemoteSearchable.docFreq(
RemoteSearchable.java:57) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(
Method.java:585) at sun.rmi.server.UnicastServerRef.dispatch(
UnicastServerRef.java:294) at sun.rmi.transport.Transport$1.run(
Transport.java:153) at java.security.AccessController.doPrivileged (Native
Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:149) at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595) at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(
StreamRemoteCall.java:247) at sun.rmi.transport.StreamRemoteCall.executeCall(
StreamRemoteCall.java:223) at sun.rmi.server.UnicastRef.invoke(
UnicastRef.java:126) at
java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(
RemoteObjectInvocationHandler.java:179) at
java.rmi.server.RemoteObjectInvocationHandler.invoke (
RemoteObjectInvocationHandler.java:132) at $Proxy0.docFreq(Unknown Source)
at org.apache.lucene.search.MultiSearcher.docFreq(MultiSearcher.java:140) at
org.apache.lucene.search.ParallelMultiSearcher.docFreq (
ParallelMultiSearcher.java:46) at org.apache.lucene.search.Similarity.idf(
Similarity.java:457) at org.apache.lucene.search.TermQuery$TermWeight.(
TermQuery.java:44) at org.apache.lucene.search.TermQuery.createWeight (
TermQuery.java:145) at org.apache.lucene.search.BooleanQuery$BooleanWeight.(
BooleanQuery.java:187) at
org.apache.lucene.search.BooleanQuery$BooleanWeight2.(BooleanQuery.java:342)
at org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:384)
at org.apache.lucene.search.Query.weight(Query.java :95) at
org.apache.lucene.search.Hits.(Hits.java:49) at
org.apache.lucene.search.Searcher.search(Searcher.java:54) at
com.sumobrain.search.SearchMaster.doSearch(SearchMaster.java:244) at
com.sumobrain.search.SearchMaster.main(SearchMaster.java:672)

Re: Issue with multiple index search

Posted by Karl Wettin <ka...@gmail.com>.
19 dec 2007 kl. 14.21 skrev Vipin Rakkanath:
> While searching, I am getting exception when one of the indexes
> has a problem. The exception is given.
>
> I edited the following methods,
>
> 1.  MultiSearcher : public int docFreq(Term term) throws IOException
> 2.  ParallelMultiSearcher : TopDocs search
>
> I deleted all problematic searchable objects from the list and did the
> search again. Now its working ok.
>
> Is this a feasible solution..?

If it works it works.

You might want to make sure it is a thread safe operation.

A possible solution that might require more work is to catching  
exceptions and return the results from the working indicies only. You  
would not have to replace the query and the application will keep  
trying to connect to that remote searcher that is temporarily out of  
reach.

-- 
karl



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