lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "游泳池的鱼" <superc...@gmail.com>
Subject Re: Query.rewrite - help me to understand it
Date Thu, 13 Dec 2007 12:07:49 GMT
hehe ,you can do a test with PrefixQuery rewrite method,and extract terms .
like this
  query = prefixQuery.rewrite(reader);
  query.extractTerms(set);
  for(String term : set){
     System.out.println(term);
 }

 It will give you a pleasant surprise.


2007/12/13, Helmut Jarausch <jarausch@igpm.rwth-aachen.de>:
>
> Hi,
>
> since I need highlighting, I need to 'rewrite' a query.
> Query.rewrite  takes an object of type IndexReader
>
> But what for?
>
> As I understand it, rewrite transforms a possibly complicated
> query into an simplified (internal?) form which is (unfortunately)
> needed by QueryScorer which is in turn need by Highlighter.
>
> What does Query.rewrite do and why does it need access to the
> index?
>
> Many thanks for an explanation,
> Helmut.
>
> --
> Helmut Jarausch
>
> Lehrstuhl fuer Numerische Mathematik
> RWTH - Aachen University
> D 52056 Aachen, Germany
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message