Package com.flaptor.indextank.index

Examples of com.flaptor.indextank.index.QueryMatcher


        BlockingDeque<QueryMatcher> matcherPool = new LinkedBlockingDeque<QueryMatcher>();
        for (int i=0; i < SEARCHER_POOL_SIZE; i++) {
            try {
                IndexSearcher searcher = new IndexSearcher(directory, true); //read-only for better concurrent performance.
                TermMatcher termMatcher = new IndexReaderTermMatcher(searcher.getIndexReader(), PAYLOAD_TERM);
                QueryMatcher matcher = new TermBasedQueryMatcher(scorer, termMatcher, this.facetingManager);   
                searcherPool.addFirst(searcher); //no blocking, throws exception.
                matcherPool.addFirst(matcher);
            } catch (CorruptIndexException cie) {
                logger.fatal("HORROR!!! corrupted index. unable to reopen", cie);
            } catch (IOException ioe) {
View Full Code Here


    public void del(String docid) {
        index.del(docid);
    }

    private QueryMatcher getMergedSearcher() {
      QueryMatcher matcher = index;
      QueryMatcher markedMatcher = markedIndex;
      if (markedMatcher != null) {
        return new BlendingQueryMatcher(markedMatcher, matcher);
      } else {
        return matcher;
      }
View Full Code Here

    }

    @Override
    public TopMatches findMatches(Query query, Predicate<DocId> idFilter, int limit, int scoringFunctionIndex) throws InterruptedException {
        BlockingDeque<QueryMatcher> queue = index.getQueryMatcherPool();
        QueryMatcher matcher = queue.takeFirst();
        try {
            return matcher.findMatches(query, idFilter, limit, scoringFunctionIndex);
        } finally {
            queue.putFirst(matcher);
        }
    }
View Full Code Here

    }

    @Override
    public TopMatches findMatches(Query query, int limit, int scoringFunctionIndex) throws InterruptedException {
        BlockingDeque<QueryMatcher> queue = index.getQueryMatcherPool();
        QueryMatcher matcher = queue.takeFirst();
        try {
            return matcher.findMatches(query, limit, scoringFunctionIndex);
        } finally {
            queue.putFirst(matcher);
        }
    }
View Full Code Here

    }

  @Override
  public boolean hasChanges(DocId docid) throws InterruptedException {
        BlockingDeque<QueryMatcher> queue = index.getQueryMatcherPool();
        QueryMatcher matcher = queue.takeFirst();
        try {
            return matcher.hasChanges(docid);
        } finally {
            queue.putFirst(matcher);
        }
  }
View Full Code Here

  }

    @Override
    public int countMatches(Query query) throws InterruptedException {
        BlockingDeque<QueryMatcher> queue = index.getQueryMatcherPool();
        QueryMatcher matcher = queue.takeFirst();
        try {
            return matcher.countMatches(query);
        } finally {
            queue.putFirst(matcher);
        }
    }
View Full Code Here

    }

    @Override
    public int countMatches(Query query, Predicate<DocId> idFilter) throws InterruptedException {
        BlockingDeque<QueryMatcher> queue = index.getQueryMatcherPool();
        QueryMatcher matcher = queue.takeFirst();
        try {
            return matcher.countMatches(query, idFilter);
        } finally {
            queue.putFirst(matcher);
        }
    }
View Full Code Here

        this.promoter = promoter;
        this.boostsManager = boostsManager;
    };

    private QueryMatcher getSearcher() {
      QueryMatcher matcher = new BlendingQueryMatcher(lsi, rti.getSearchSession());
      matcher = new BlendingQueryMatcher(matcher, promoter);
      return matcher;
    }
View Full Code Here

        this.res = res;
    }

    @Override
    public QueryMatcher getSearchSession() {
        return new QueryMatcher() {
          @Override
          public TopMatches findMatches(Query query, Predicate<DocId> docFilter, int limit, int scoringFunctionIndex) {
            return res;
          }
            @Override
View Full Code Here

TOP

Related Classes of com.flaptor.indextank.index.QueryMatcher

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.