Examples of score()


Examples of org.apache.lucene.search.Hits.score()

      long itemId = Long.parseLong(doc.get(ItemFieldConstants.ITEM_ID));
      ItemIF item = channel.getItem(itemId);
      if (item == null) {
        throw new UnretrievableException("item " + itemId);
      }
      results.add(new ItemResult(item, hits.score(i)));
    }
    searcher.close();
    return results;
  }
View Full Code Here

Examples of org.apache.lucene.search.Scorer.score()

    Scorer spanScorer = snq.weight(searcher).scorer(searcher.getIndexReader(), true, false);

    assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
    assertEquals("first doc number", spanScorer.docID(), 11);
    float score = spanScorer.score();
    assertTrue("first doc score should be zero, " + score, score == 0.0f);
    assertTrue("no second doc", spanScorer.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
  }

  // LUCENE-1404
View Full Code Here

Examples of org.apache.lucene.search.Scorer.score()

    );

    assertTrue(scorer1.advance(0) != DocIdSetIterator.NO_MORE_DOCS);
    assertEquals(1, scorer1.docID());
    assertEquals(2, scorer1.freq(), 0);
    final float score1 = scorer1.score();
    assertTrue(scorer1.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
    assertEquals(2, scorer1.docID());
    assertEquals(2, scorer1.freq(), 0);
    final float score2 = scorer1.score();
    assertTrue(score1 > score2);
View Full Code Here

Examples of org.apache.lucene.search.Scorer.score()

    assertEquals(2, scorer1.freq(), 0);
    final float score1 = scorer1.score();
    assertTrue(scorer1.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
    assertEquals(2, scorer1.docID());
    assertEquals(2, scorer1.freq(), 0);
    final float score2 = scorer1.score();
    assertTrue(score1 > score2);
    assertTrue(scorer1.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
  }

}
View Full Code Here

Examples of org.apache.lucene.search.Scorer.score()

    Scorer spanScorer = searcher.createNormalizedWeight(snq).scorer(searcher.getIndexReader(), true, false);

    assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
    assertEquals("first doc number", spanScorer.docID(), 11);
    float score = spanScorer.score();
    assertTrue("first doc score should be zero, " + score, score == 0.0f);
    assertTrue("no second doc", spanScorer.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
  }

  // LUCENE-1404
View Full Code Here

Examples of org.apache.lucene.search.Scorer.score()

        searcher.setSimilarity(oldSim);
      }
      if (i == subIndex) {
        assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
        assertEquals("first doc number", spanScorer.docID() + ctx.docBase, 11);
        float score = spanScorer.score();
        assertTrue("first doc score should be zero, " + score, score == 0.0f);
      else {
        assertTrue("no second doc", spanScorer.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
      }
    }
View Full Code Here

Examples of org.apache.lucene.search.Scorer.score()

        assert scorer != null;
        return new DoubleDocValues(this) {
          @Override
          public double doubleVal(int document) {
            try {
              return scorer.score();
            } catch (IOException exception) {
              throw new RuntimeException(exception);
            }
          }
        };
View Full Code Here

Examples of org.apache.lucene.search.features.querydependent.PwaBM25.score()

   
    Vector<Integer> idf=new Vector<Integer>();
    idf.add(1000);
     
    PwaBM25 ranker=new PwaBM25(tf,idf,100,1000.0,10000000);
    System.out.println(ranker.score());
        assertTrue(ranker.score()==9.862371362773622);
  }

}
View Full Code Here

Examples of org.apache.lucene.search.features.querydependent.PwaLuceneSimilarity.score()

   
    nTermsPerField.add(1000);
    nTermsPerField.add(1000);
     
    PwaLuceneSimilarity ranker=new PwaLuceneSimilarity(tfPerField,idfPerField,nTermsPerField,10000000);
    System.out.println(ranker.score());
        assertTrue(true);
  }
}
View Full Code Here

Examples of org.apache.lucene.search.features.querydependent.PwaMinSpan.score()

  protected void tearDown() throws Exception {
  }

  public void testScore() {       
    PwaMinSpan ranker=new PwaMinSpan(0)
    System.out.println(ranker.score());
    ranker=new PwaMinSpan(1)
    System.out.println(ranker.score());
    ranker=new PwaMinSpan(2)
    System.out.println(ranker.score());
    ranker=new PwaMinSpan(3)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.