lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: The values which compute scores. - Part II
Date Sun, 03 Jun 2007 22:36:46 GMT

: I guess you could hack a "all norms are 1" behavior by
: writing something similar to OneNormsReader in
: org.apache.lucene.demo.SearchFiles.

Wow ... that's quite the little hidden gem in the Demo.

The gist of the impl is pretty much exactly what you need, but
SegmentReader has a static utility to make things easy...

  public class FlatNormsIndexReader extends FilterIndexReader {
    public FlatNormsIndexReader(IndexReder r) { super(r); }
    public byte[] norms(String field) {
      return SegmentReader.createFakeNorms(maxDoc());
    }
  }



-Hoss


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