Package org.apache.lucene.search

Examples of org.apache.lucene.search.TimeLimitingCollector


          if ( timeoutManager.getType() == TimeoutManager.Type.LIMIT && timeoutManager.isTimedOut() ) {
            timeoutManager.forceTimedOut();
            timeoutAt0 = true;
          }
        }
        maybeTimeLimitingCollector = new TimeLimitingCollector(topCollector, timeoutLeft );
      }
      else {
        if ( timeoutManager.getType() == TimeoutManager.Type.LIMIT && timeoutManager.isTimedOut() ) {
          timeoutManager.forceTimedOut();
        }
View Full Code Here


    Collector maybeTimeLimitingCollector = collector;
    if ( timeoutManager.getType() == TimeoutManager.Type.LIMIT ) {
      final Long timeoutLeft = timeoutManager.getTimeoutLeftInMilliseconds();
      if ( timeoutLeft != null ) {
        Counter counter = timeoutManager.getLuceneTimeoutCounter();
        maybeTimeLimitingCollector = new TimeLimitingCollector( collector, counter, timeoutLeft);
      }
    }
    return maybeTimeLimitingCollector;
  }
View Full Code Here

    Collector maybeTimeLimitingCollector = collector;
    if ( timeoutManager.getType() == TimeoutManager.Type.LIMIT ) {
      final Long timeoutLeft = timeoutManager.getTimeoutLeftInMilliseconds();
      if ( timeoutLeft != null ) {
        Counter counter = timeoutManager.getLuceneTimeoutCounter();
        maybeTimeLimitingCollector = new TimeLimitingCollector( collector, counter, timeoutLeft);
      }
    }
    return maybeTimeLimitingCollector;
  }
View Full Code Here

  private Collector decorateWithTimeOutCollector(Collector collector) {
    Collector maybeTimeLimitingCollector = collector;
    if ( timeoutManager.getType() == TimeoutManager.Type.LIMIT ) {
      final Long timeoutLeft = timeoutManager.getTimeoutLeftInMilliseconds();
      if ( timeoutLeft != null ) {
        maybeTimeLimitingCollector = new TimeLimitingCollector( collector, timeoutLeft );
      }
    }
    return maybeTimeLimitingCollector;
  }
View Full Code Here

  private Collector decorateWithTimeOutCollector(Collector collector) {
    Collector maybeTimeLimitingCollector = collector;
    if ( timeoutManager.getType() == TimeoutManager.Type.LIMIT ) {
      final Long timeoutLeft = timeoutManager.getTimeoutLeftInMilliseconds();
      if ( timeoutLeft != null ) {
        maybeTimeLimitingCollector = new TimeLimitingCollector( collector, timeoutLeft );
      }
    }
    return maybeTimeLimitingCollector;
  }
View Full Code Here

  public IntervalLimitedCollector(int maxTime, boolean outOfOrder, boolean shouldScore) {
    this.maxTime = maxTime;
    this.outOfOrder = outOfOrder;
    this.shouldScore = shouldScore;
    tdc = TopScoreDocCollector.create(1000, outOfOrder);
    thc = new TimeLimitingCollector(tdc, TimeLimitingCollector.getGlobalCounter(), maxTime);
  }
View Full Code Here

  @Override
  public void reset() {
    lastDoc = 0;
    tdc = TopScoreDocCollector.create(1000, outOfOrder);
    thc = new TimeLimitingCollector(tdc, TimeLimitingCollector.getGlobalCounter(), maxTime);
  }
View Full Code Here

    Collector maybeTimeLimitingCollector = collector;
    if ( timeoutManager.getType() == TimeoutManager.Type.LIMIT ) {
      final Long timeoutLeft = timeoutManager.getTimeoutLeftInMilliseconds();
      if ( timeoutLeft != null ) {
        Counter counter = timeoutManager.getLuceneTimeoutCounter();
        maybeTimeLimitingCollector = new TimeLimitingCollector( collector, counter, timeoutLeft);
      }
    }
    return maybeTimeLimitingCollector;
  }
View Full Code Here

            // to any scoped collectors, also, it will only be applied to the main collector
            // since that is where the filter should only work
            collector = new FilteredCollector(collector, searchContext.parsedFilter());
        }
        if (searchContext.timeout() != null) {
            collector = new TimeLimitingCollector(collector, searchContext.timeout().millis());
        }
        if (scopeCollectors != null) {
            List<Collector> collectors = scopeCollectors.get(processingScope);
            if (collectors != null && !collectors.isEmpty()) {
                collector = new MultiCollector(collector, collectors.toArray(new Collector[collectors.size()]));
View Full Code Here

    @SuppressWarnings({ "rawtypes" })
    private Collector wrapInTimeoutCollector(TopDocsCollector resultCollector) {
      if (_timeout <= 0) {
        return resultCollector;
      }
      return new TimeLimitingCollector(resultCollector, _timeout);
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.TimeLimitingCollector

Copyright © 2018 www.massapicom. 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.