Examples of scorer()


Examples of org.apache.lucene.search.Weight.scorer()

   * this causes problems
   */
  public void testSpanNearScorerExplain() throws Exception {
    SpanNearQuery q = makeQuery();
    Weight w = q.createWeight(searcher);
    Scorer s = w.scorer(searcher.getIndexReader());
    Explanation e = s.explain(1);
    assertTrue("Scorer explanation value for doc#1 isn't positive: "
               + e.toString(),
               0.0f < e.getValue());
  }
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

   * this causes problems
   */
  public void testSpanNearScorerSkipTo1() throws Exception {
    SpanNearQuery q = makeQuery();
    Weight w = q.weight(searcher);
    Scorer s = w.scorer(searcher.getIndexReader(), true, false);
    assertEquals(1, s.advance(1));
  }
  /**
   * not a direct test of NearSpans, but a demonstration of how/when
   * this causes problems
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

   * this causes problems
   */
  public void testSpanNearScorerExplain() throws Exception {
    SpanNearQuery q = makeQuery();
    Weight w = q.weight(searcher);
    Scorer s = w.scorer(searcher.getIndexReader(), true, false);
    Explanation e = s.explain(1);
    assertTrue("Scorer explanation value for doc#1 isn't positive: "
               + e.toString(),
               0.0f < e.getValue());
  }
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

    while(iter.hasNext()) {
      Entry entry = (Entry) iter.next();
      Query query = (Query) entry.getKey();
      int limit = ((Integer) entry.getValue()).intValue();
      Weight weight = query.weight(searcher);
      Scorer scorer = weight.scorer(reader, true, false);
      if (scorer != null) {
        while(true)  {
          int doc = scorer.nextDoc();
          if (((long) docIDStart) + doc >= limit)
            break;
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

    IndexSearcher searcher = new IndexSearcher(reader);
    for (Entry<Query, Integer> entry : deletesFlushed.queries.entrySet()) {
      Query query = entry.getKey();
      int limit = entry.getValue().intValue();
      Weight weight = query.weight(searcher);
      Scorer scorer = weight.scorer(reader, true, false);
      if (scorer != null) {
        while(true)  {
          int doc = scorer.nextDoc();
          if (((long) docIDStart) + doc >= limit)
            break;
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

    for (String field : lucene2SeqConfiguration.getFields()) {
        LuceneIndexHelper.fieldShouldExistInIndex(searcher, field);
    }

    Weight weight = lucene2SeqConfiguration.getQuery().createWeight(searcher);
    scorer = weight.scorer(segmentReader.getContext(), false, false, null);
    if (scorer == null) {
      throw new IllegalArgumentException("Could not create query scorer for query: "
          + lucene2SeqConfiguration.getQuery());
    }
  }
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

    for (String field : lucene2SeqConfiguration.getFields()) {
        LuceneIndexHelper.fieldShouldExistInIndex(segmentReader, field);
    }

    Weight weight = lucene2SeqConfiguration.getQuery().createWeight(searcher);
    scorer = weight.scorer(segmentReader.getContext(), false, false, null);
    if (scorer == null) {
      throw new IllegalArgumentException("Could not create query scorer for query: "
          + lucene2SeqConfiguration.getQuery());
    }
  }
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

    while(iter.hasNext()) {
      Entry entry = (Entry) iter.next();
      Query query = (Query) entry.getKey();
      int limit = ((Integer) entry.getValue()).intValue();
      Weight weight = query.weight(searcher);
      Scorer scorer = weight.scorer(reader, true, false);
      if (scorer != null) {
        while(true)  {
          int doc = scorer.nextDoc();
          if (((long) docIDStart) + doc >= limit)
            break;
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

   * this causes problems
   */
  public void testSpanNearScorerSkipTo1() throws Exception {
    SpanNearQuery q = makeQuery();
    Weight w = q.weight(searcher);
    Scorer s = w.scorer(searcher.getIndexReader(), true, false);
    assertEquals(1, s.advance(1));
  }
  /**
   * not a direct test of NearSpans, but a demonstration of how/when
   * this causes problems
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

    try {
      for (QueryAndLimit ent : queriesIter) {
        Query query = ent.query;
        int limit = ent.limit;
        Weight weight = query.weight(searcher);
        Scorer scorer = weight.scorer(reader, true, false);
        if (scorer != null) {
          while(true)  {
            int doc = scorer.nextDoc();
            if (doc >= limit)
              break;
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.