Examples of scorer()


Examples of org.apache.lucene.search.BooleanQuery.BooleanWeight.scorer()

    BooleanWeight weight = (BooleanWeight) searcher.createNormalizedWeight(bq);
   
    if (slow) {
      return new SlowMinShouldMatchScorer(weight, reader, searcher);
    } else {
      return weight.scorer(reader.getContext(), true, false, null);
    }
  }
 
  private void assertNext(Scorer expected, Scorer actual) throws Exception {
    if (actual == null) {
View Full Code Here

Examples of org.apache.lucene.search.BooleanQuery.BooleanWeight.scorer()

    BooleanWeight weight = (BooleanWeight) searcher.createNormalizedWeight(bq);
   
    if (slow) {
      return new SlowMinShouldMatchScorer(weight, reader, searcher);
    } else {
      return weight.scorer(reader.getContext(), true, false, null);
    }
  }
 
  private void assertNext(Scorer expected, Scorer actual) throws Exception {
    if (actual == null) {
View Full Code Here

Examples of org.apache.lucene.search.BooleanQuery.BooleanWeight.scorer()

    BooleanWeight weight = (BooleanWeight) searcher.createNormalizedWeight(bq);
   
    if (slow) {
      return new SlowMinShouldMatchScorer(weight, reader, searcher);
    } else {
      return weight.scorer(reader.getContext(), true, false, null);
    }
  }
 
  private void assertNext(Scorer expected, Scorer actual) throws Exception {
    if (actual == null) {
View Full Code Here

Examples of org.apache.lucene.search.BooleanQuery.BooleanWeight.scorer()

    BooleanWeight weight = (BooleanWeight) searcher.createNormalizedWeight(bq);
   
    if (slow) {
      return new SlowMinShouldMatchScorer(weight, reader, searcher);
    } else {
      return weight.scorer(reader.getContext(), null);
    }
  }
 
  private void assertNext(Scorer expected, Scorer actual) throws Exception {
    if (actual == null) {
View Full Code Here

Examples of org.apache.lucene.search.TermQuery.TermWeight.scorer()

      // needs scores

      final DocsAndFreqs[] docsAndFreqs = new DocsAndFreqs[weights.size()];
      for (int i = 0; i < docsAndFreqs.length; i++) {
        final TermWeight weight = (TermWeight) weights.get(i);
        final Scorer scorer = weight.scorer(context, true, false, acceptDocs);
        if (scorer == null) {
          return null;
        } else {
          assert scorer instanceof TermScorer;
          docsAndFreqs[i] = new DocsAndFreqs((TermScorer) scorer);
View Full Code Here

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

            List<Query> filters = rb.getFilters();
            if (filters!=null){
              final ArrayList<DocIdSet> docsets = new ArrayList<DocIdSet>(filters.size());
                for (Query filter : filters){
                  Weight weight = filter.createWeight(rb.req.getSearcher());
                  final Scorer scorer = weight.scorer(reader, false, true);
                  docsets.add(new DocIdSet(){
                @Override
                public DocIdSetIterator iterator() throws IOException {
                  return scorer;
                }
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()

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

  protected Scorer getScorer(final Query query) throws IOException {
    final Weight weight = searcher.createNormalizedWeight(query);
    assertTrue(searcher.getTopReaderContext() instanceof AtomicReaderContext);
    final AtomicReaderContext context = (AtomicReaderContext) searcher.getTopReaderContext();
    return weight.scorer(context, true, true, context.reader().getLiveDocs());
  }

  public static abstract class LuceneQueryBuilder {

    public abstract Query 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
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.