lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: Uable to extends TopTermsRewrite in Lucene 4.1
Date Thu, 04 Apr 2013 20:21:16 GMT

this looks also fine. If the generics in the FuzzyRewrite from the last mail are correct,
the cast in this rewrite is not needed, too (and DisjunctionMaxQuery implements Iterable,
so you can use a simple for-loop):

          public Query rewrite(final IndexReader reader, final MultiTermQuery query) throws
IOException {
              DisjunctionMaxQuery  dmq = rewrite.rewrite(reader, query);
              float idfBoost = getQueryBoost(reader, query);
              for (final Query q : dmq) {
                  q.setBoost(q.getBoost() * idfBoost);
              return dmq;

On the other hand, why not simply boost the whole dmq?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message