15 jul 2008 kl. 18.11 skrev John Patterson:


So it seems that creating a constant scoring TermQuery is the best
suggestion so far.

Would be really great if I could call BooleanQuery.setConstantScore(1.0f) or
something.


You might be looking at implementing something like

public class NonScoringQueryDecorator extends Query {

  private Query decorated;

  public NonScoringQueryDecorator(Query decorated) {
    this.decorated = decorated;
  }

  protected Weight createWeight(Searcher searcher) throws IOException {
    Weight decoratedWeight = this.decorated.createWeight(searcher);
    return new Weight() {
      public Scorer scorer(IndexReader reader) throws IOException {
        return new Scorer(){
          public float score() throws IOException {
            return 1f;
          }
        };
      }
    };
  }


Feel free to post it as an issue in the Jira when it's implemented.


        karl




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to