lucene-java-user mailing list archives

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

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

          @Override
          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?

Uwe


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