Codota Logo
CollectionTerminatedException.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.apache.lucene.search.CollectionTerminatedException
constructor

Best Java code snippets using org.apache.lucene.search.CollectionTerminatedException.<init> (Showing top 20 results out of 315)

  • Common ways to obtain CollectionTerminatedException
private void myMethod () {
CollectionTerminatedException c =
  • Codota Iconnew CollectionTerminatedException()
  • Smart code suggestions by Codota
}
origin: org.apache.lucene/lucene-core

@Override
public void collect(int doc) throws IOException {
 super.collect(doc);
 if (++numCollected >= numDocsToCollect) {
  terminatedEarly.set(true);
  throw new CollectionTerminatedException();
 }
}
origin: org.apache.lucene/lucene-core

@Override
public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException {
 final List<LeafCollector> leafCollectors = new ArrayList<>();
 for (Collector collector : collectors) {
  final LeafCollector leafCollector;
  try {
   leafCollector = collector.getLeafCollector(context);
  } catch (CollectionTerminatedException e) {
   // this leaf collector does not need this segment
   continue;
  }
  leafCollectors.add(leafCollector);
 }
 switch (leafCollectors.size()) {
  case 0:
   throw new CollectionTerminatedException();
  case 1:
   return leafCollectors.get(0);
  default:
   return new MultiLeafCollector(leafCollectors, cacheScores);
 }
}
origin: org.apache.lucene/lucene-core

@Override
public void collect(int doc) throws IOException {
 final LeafCollector[] collectors = this.collectors;
 int numCollectors = this.numCollectors;
 for (int i = 0; i < numCollectors; ) {
  final LeafCollector collector = collectors[i];
  try {
   collector.collect(doc);
   ++i;
  } catch (CollectionTerminatedException e) {
   removeCollector(i);
   numCollectors = this.numCollectors;
   if (numCollectors == 0) {
    throw new CollectionTerminatedException();
   }
  }
 }
}
origin: org.elasticsearch/elasticsearch

@Override
public void visit(int docID, byte[] packedValue) {
  if (liveDocs.get(docID)) {
    result[0] = converter.apply(packedValue);
    // this is the first leaf with a live doc so the value is the minimum for this segment.
    throw new CollectionTerminatedException();
  }
}
origin: org.apache.lucene/lucene-core

 throw new CollectionTerminatedException();
} else {
 collectedAllCompetitiveHits = true;
origin: org.apache.lucene/lucene-core

 throw new CollectionTerminatedException();
} else {
 collectedAllCompetitiveHits = true;
origin: org.elasticsearch/elasticsearch

  @Override
  public void collect(int doc) throws IOException {
    if (++numCollected > maxCountHits) {
      if (forceTermination) {
        throw new EarlyTerminationException("early termination [CountBased]");
      } else {
        throw new CollectionTerminatedException();
      }
    }
    super.collect(doc);
  };
};
origin: org.elasticsearch/elasticsearch

@Override
public void collect(int docID, CharSequence key, CharSequence context, float score) throws IOException {
  int globalDoc = docID + docBase;
  boolean isDuplicate = docContexts.containsKey(globalDoc);
  List<CharSequence> contexts = docContexts.computeIfAbsent(globalDoc, k -> new ArrayList<>());
  if (context != null) {
    contexts.add(context);
  }
  if (isDuplicate) {
    return;
  }
  TopSuggestDocs.SuggestScoreDoc current = new TopSuggestDocs.SuggestScoreDoc(globalDoc, key, context, score);
  if (current == priorityQueue.insertWithOverflow(current)) {
    // if the current SuggestScoreDoc has overflown from pq,
    // we can assume all of the successive collections from
    // this leaf will be overflown as well
    // TODO: reuse the overflow instance?
    throw new CollectionTerminatedException();
  }
}
origin: org.elasticsearch/elasticsearch

@Override
public LeafBucketCollector getLeafCollector(LeafReaderContext context) throws IOException {
  final List<LeafBucketCollector> leafCollectors = new ArrayList<>();
  for (BucketCollector collector : collectors) {
    final LeafBucketCollector leafCollector;
    try {
      leafCollector = collector.getLeafCollector(context);
    } catch (CollectionTerminatedException e) {
      // this leaf collector does not need this segment
      continue;
    }
    leafCollectors.add(leafCollector);
  }
  switch (leafCollectors.size()) {
    case 0:
      throw new CollectionTerminatedException();
    case 1:
      return leafCollectors.get(0);
    default:
      return new MultiLeafBucketCollector(leafCollectors, cacheScores);
  }
}
origin: org.elasticsearch/elasticsearch

  @Override
  public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException {
    if (numCollected >= maxCountHits) {
      if (forceTermination) {
        throw new EarlyTerminationException("early termination [CountBased]");
      } else {
        throw new CollectionTerminatedException();
      }
    }
    return new FilterLeafCollector(super.getLeafCollector(context)) {
      @Override
      public void collect(int doc) throws IOException {
        if (++numCollected > maxCountHits) {
          if (forceTermination) {
            throw new EarlyTerminationException("early termination [CountBased]");
          } else {
            throw new CollectionTerminatedException();
          }
        }
        super.collect(doc);
      };
    };
  }
}
origin: org.elasticsearch/elasticsearch

  @Override
  public void collect(int doc, long bucket) throws IOException {
    final LeafBucketCollector[] collectors = this.collectors;
    int numCollectors = this.numCollectors;
    for (int i = 0; i < numCollectors; ) {
      final LeafBucketCollector collector = collectors[i];
      try {
        collector.collect(doc, bucket);
        ++i;
      } catch (CollectionTerminatedException e) {
        removeCollector(i);
        numCollectors = this.numCollectors;
        if (numCollectors == 0) {
          throw new CollectionTerminatedException();
        }
      }
    }
  }
}
origin: org.elasticsearch/elasticsearch

} else {
  throw new CollectionTerminatedException();
  mins.set(0, min);
  throw new CollectionTerminatedException();
origin: org.elasticsearch/elasticsearch

} else {
  throw new CollectionTerminatedException();
  maxes.set(0, max);
  throw new CollectionTerminatedException();
origin: org.elasticsearch/elasticsearch

  throw new CollectionTerminatedException();
} else {
  if (fillDocIdSet) {
origin: org.elasticsearch/elasticsearch

@Override
public void visit(int docID, byte[] packedValue) throws IOException {
  if (compare(packedValue, packedValue) != PointValues.Relation.CELL_CROSSES_QUERY) {
    remaining --;
    return;
  }
  long bucket = bucketFunction.applyAsLong(packedValue);
  if (first == false && bucket != lastBucket) {
    final DocIdSet docIdSet = bucketDocsBuilder.build();
    if (processBucket(queue, context, docIdSet.iterator(), lastBucket, builder) &&
        // lower bucket is inclusive
        lowerBucket != lastBucket) {
      // this bucket does not have any competitive composite buckets,
      // we can early terminate the collection because the remaining buckets are guaranteed
      // to be greater than this bucket.
      throw new CollectionTerminatedException();
    }
    bucketDocsBuilder = new DocIdSetBuilder(maxDoc);
    assert remaining > 0;
    adder = bucketDocsBuilder.grow(remaining);
  }
  lastBucket = bucket;
  first = false;
  adder.add(docID);
  remaining --;
}
origin: org.infinispan/infinispan-embedded-query

@Override
public void collect(int doc) throws IOException {
 super.collect(doc);
 if (++numCollected >= numDocsToCollect) {
  terminatedEarly.set(true);
  throw new CollectionTerminatedException();
 }
}
origin: harbby/presto-connectors

@Override
public void collect(int doc) throws IOException {
 super.collect(doc);
 if (++numCollected >= numDocsToCollect) {
  terminatedEarly.set(true);
  throw new CollectionTerminatedException();
 }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

@Override
public void collect(int doc) throws IOException {
 super.collect(doc);
 if (++numCollected >= numDocsToCollect) {
  terminatedEarly.set(true);
  throw new CollectionTerminatedException();
 }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

  @Override
  public void collect(int doc) throws IOException {
    if (++numCollected > maxCountHits) {
      if (forceTermination) {
        throw new EarlyTerminationException("early termination [CountBased]");
      } else {
        throw new CollectionTerminatedException();
      }
    }
    super.collect(doc);
  };
};
origin: apache/servicemix-bundles

  @Override
  public void collect(int doc) throws IOException {
    if (++numCollected > maxCountHits) {
      if (forceTermination) {
        throw new EarlyTerminationException("early termination [CountBased]");
      } else {
        throw new CollectionTerminatedException();
      }
    }
    super.collect(doc);
  };
};
org.apache.lucene.searchCollectionTerminatedException<init>

Javadoc

Sole constructor.

Popular methods of CollectionTerminatedException

    Popular in Java

    • Reading from database using SQL prepared statement
    • compareTo (BigDecimal)
    • getApplicationContext (Context)
    • getSharedPreferences (Context)
    • GridLayout (java.awt)
      The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
    • Connection (java.sql)
      A connection represents a link from a Java application to a database. All SQL statements and results
    • Calendar (java.util)
      Calendar is an abstract base class for converting between a Date object and a set of integer fields
    • ResourceBundle (java.util)
      Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
    • TimeUnit (java.util.concurrent)
      A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
    • Logger (org.slf4j)
      The main user interface to logging. It is expected that logging takes place through concrete impleme
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Codota for your IDE now