lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Help on the ParallelMultiSearcher.rewrite(Query) method
Date Thu, 07 Jul 2005 20:52:01 GMT
Terence - you need to do the rewrite using the appropriate  
IndexReader for a single index.  You can use query.rewrite(IndexReader).

     Erik


On Jul 7, 2005, at 3:04 PM, Terence Lai wrote:

> Hi all,
>
> I am currently using Lucene 1.4.2. Since my search documents are  
> huge, I divide the search index into different index directory and  
> make use of the ParallelMultiSearcher to perform the search.
>
> Currently, I am working on the highlight feature using Lucene  
> Sandbox Highlighter. One of the requirements is to convert the  
> Query into the primitive form. I invoked the  
> ParallelMultiSearcher.rewrite(Query). However, I got the exception,  
> UnsupportedOperationException.
>
> I start studying the source code. I discover that the  
> ParallelMultiSearcher calls Query.combine() method to combine  
> multiple primitive query into a single one. By looking at the  
> Query.java, the method hasn't been implemented as you see below:
>
>   /** Expert: called when re-writing queries under MultiSearcher.
>    *
>    * <p>Only implemented by derived queries, with no
>    * {@link #createWeight(Searcher)} implementatation.
>    */
>   public Query combine(Query[] queries) {
>     throw new UnsupportedOperationException();
>   }
>
> Does anyone know any alternative to rewrite the query if I have  
> multiple index directories?
>
> Thanks,
> Terence
>
>
>
>
> ----------------------------------------------------------
> Get your free email account from http://www.trekspace.com
>           Your Internet Virtual Desktop!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


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


Mime
View raw message