Hi Erik,
I have implemented the way as you described, and it is now working probably.
However, I have a concern on the performance of my implementation.
Since I am using parallelMultiSearcher to perform the search. I have no idea on
which index directory is corresponding to the document that I am trying to
highlight. The way my application works is indicated as follows:
1) user enter a keyword search criteria for the document contents
2) the system returns a list of document titles with hyper links to drill down
to the contents.
3) upon the user click the hyper link of the individual document, the
application will perform the highlight based on the search criteria cached from
Step (1)
Because of this, the application does not keep track of which index directory
is associated with the search result document. Currently, I have to make
another search using the document primary key to locate the searcher, and using
this individual searcher to rewrite my query. However, it invokes an extra
search operation which may be costly.
Therefore, I originally tried to use the ParallelMultiSearcher.rewrite() to
convert the query into a primitive form. Doing this way, I don't need to worry
about which index directory is belong to the index document. Is there any
reason why the method not being supported?
I am trying to think of an alternative way. Is that possible for me to loop
through all the individual searchers and perform an IndexSearcher.rewrite with
each searcher. At the end, I create a BooleanQuery to join them together with
BooleanQuery(subQuery, false, false); Do you think this will work? Is there any
issue if I do this?
Thanks,
Terence
> 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
> > * [EMAIL PROTECTED] #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: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
----------------------------------------------------------
Get your free email account from http://www.trekspace.com
Your Internet Virtual Desktop!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]