Package org.apache.lucene.search

Examples of org.apache.lucene.search.SearcherFactory


  /** Creates near-real-time searcher and taxonomy reader
   *  from the corresponding writers. */
  public SearcherTaxonomyManager(IndexWriter writer, boolean applyAllDeletes, SearcherFactory searcherFactory, DirectoryTaxonomyWriter taxoWriter) throws IOException {
    if (searcherFactory == null) {
      searcherFactory = new SearcherFactory();
    }
    this.searcherFactory = searcherFactory;
    this.taxoWriter = taxoWriter;
    DirectoryTaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoWriter);
    current = new SearcherAndTaxonomy(SearcherManager.getSearcher(searcherFactory, DirectoryReader.open(writer, applyAllDeletes)),
View Full Code Here


    simpleTimer.stop("writerOpen");
    simpleTimer.start("nrtSetup");
    _recorder = new TransactionRecorder(shardContext);
    _recorder.replay(_writer);

    _searcherFactory = new SearcherFactory() {
      @Override
      public IndexSearcher newSearcher(IndexReader reader) throws IOException {
        return new IndexSearcherClosableNRT(reader, searchExecutor, _nrtManagerRef, _directory);
      }
    };
View Full Code Here

      locks[i] = new Object();
    }

    final AtomicLong nextVersion = new AtomicLong();

    final SearcherManager mgr = new SearcherManager(w.w, true, new SearcherFactory());

    final Long missingValue = -1L;

    final LiveFieldValues<IndexSearcher,Long> versionValues = new LiveFieldValues<IndexSearcher,Long>(mgr, missingValue) {
      @Override
View Full Code Here

   * uses can tolerate seeing some deleted docs, since
   * reopen time is faster if deletes need not be applied. */
  public NRTManager(TrackingIndexWriter writer, SearcherFactory searcherFactory, boolean applyAllDeletes) throws IOException {
    this.writer = writer;
    if (searcherFactory == null) {
      searcherFactory = new SearcherFactory();
    }
    this.searcherFactory = searcherFactory;
    current = SearcherManager.getSearcher(searcherFactory, DirectoryReader.open(writer.getIndexWriter(), applyAllDeletes));
  }
View Full Code Here

  /** Creates near-real-time searcher and taxonomy reader
   *  from the corresponding writers. */
  public SearcherTaxonomyManager(IndexWriter writer, boolean applyAllDeletes, SearcherFactory searcherFactory, DirectoryTaxonomyWriter taxoWriter) throws IOException {
    if (searcherFactory == null) {
      searcherFactory = new SearcherFactory();
    }
    this.searcherFactory = searcherFactory;
    this.taxoWriter = taxoWriter;
    DirectoryTaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoWriter);
    current = new SearcherAndTaxonomy(SearcherManager.getSearcher(searcherFactory, DirectoryReader.open(writer, applyAllDeletes)),
View Full Code Here

    IndexWriter writer = getWriter(directory);

    ReferenceManager<IndexSearcher> mgr = new SearcherManager(writer,
                                                              true,
                                                              new SearcherFactory());

    TrackingIndexWriter mgrWriter = new TrackingIndexWriter(writer);

    IndexSearcher searcher = mgr.acquire();
View Full Code Here

    IndexWriter writer = getWriter(directory);

    ReferenceManager<IndexSearcher> mgr = new SearcherManager(writer,
                                                              true,
                                                              new SearcherFactory());

    IndexSearcher searcher = mgr.acquire();

    TopDocs topDocs = searcher.search(new TermQuery(new Term("foo", "0")),
                                      100);
View Full Code Here

    IndexWriter writer = getWriter(directory);

    ReferenceManager<IndexSearcher> mgr = new SearcherManager(writer,
                                                              true,
                                                              new SearcherFactory());

    IndexSearcher searcher = mgr.acquire();

    TopDocs topDocs = searcher.search(new TermQuery(new Term("foo", "0")),
                                      100);
View Full Code Here

  /** Creates near-real-time searcher and taxonomy reader
   *  from the corresponding writers. */
  public SearcherTaxonomyManager(IndexWriter writer, boolean applyAllDeletes, SearcherFactory searcherFactory, DirectoryTaxonomyWriter taxoWriter) throws IOException {
    if (searcherFactory == null) {
      searcherFactory = new SearcherFactory();
    }
    this.searcherFactory = searcherFactory;
    this.taxoWriter = taxoWriter;
    DirectoryTaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoWriter);
    current = new SearcherAndTaxonomy(SearcherManager.getSearcher(searcherFactory, DirectoryReader.open(writer, applyAllDeletes)), taxoReader);
View Full Code Here

   * {@link #maybeRefresh()} in the same thread. Otherwise it could lead to an
   * unsync'd {@link IndexSearcher} and {@link TaxonomyReader} pair.
   */
  public SearcherTaxonomyManager(Directory indexDir, Directory taxoDir, SearcherFactory searcherFactory) throws IOException {
    if (searcherFactory == null) {
      searcherFactory = new SearcherFactory();
    }
    this.searcherFactory = searcherFactory;
    DirectoryTaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
    current = new SearcherAndTaxonomy(SearcherManager.getSearcher(searcherFactory, DirectoryReader.open(indexDir)), taxoReader);
    this.taxoWriter = null;
View Full Code Here

TOP

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

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.