lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Schnober <schno...@ids-mannheim.de>
Subject Re: Rewrite for RegexpQuery
Date Mon, 11 Mar 2013 13:29:49 GMT
Am 11.03.2013 14:13, schrieb Uwe Schindler:

>> Regarding the application of IndexSearcher.rewrite(Query) instead: I don't
>> see a way to set the rewrite method there because the Query's rewrite
>> method does not seem to apply to IndexSearcher.rewrite().
> 
> Replace:
>> BooleanQuery bq = (BooleanQuery) query.rewrite(reader);
> 
> With:
>> BooleanQuery bq = (BooleanQuery) indexSearcher.rewrite(query);
> 
> Otherwise you have to create a while-loop that rewrites the return value again until
rewrite() returns itself.

Right, I was under the false impression that the rewrite method set for
the initial query was not considered by IndexSearcher.rewrite().
Best,
Carsten

-- 
Institut für Deutsche Sprache | http://www.ids-mannheim.de
Projekt KorAP                 | http://korap.ids-mannheim.de
Tel. +49-(0)621-43740789      | schnober@ids-mannheim.de
Korpusanalyseplattform der nächsten Generation
Next Generation Corpus Analysis Platform

---------------------------------------------------------------------
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