Package org.apache.lucene.index

Examples of org.apache.lucene.index.ExtendedIndexSearcher


                    if (dirty || refresh.force()) {
                        dirty = false;
                        AcquirableResource<ReaderSearcherHolder> current = nrtResource;
                        IndexReader newReader = current.resource().reader().reopen(true);
                        if (newReader != current.resource().reader()) {
                            ExtendedIndexSearcher indexSearcher = new ExtendedIndexSearcher(newReader);
                            indexSearcher.setSimilarity(similarityService.defaultSearchSimilarity());
                            nrtResource = newAcquirableResource(new ReaderSearcherHolder(indexSearcher));
                            current.markForClose();
                        }
                    }
                }
View Full Code Here


        }
    }

    private AcquirableResource<ReaderSearcherHolder> buildNrtResource(IndexWriter indexWriter) throws IOException {
        IndexReader indexReader = IndexReader.open(indexWriter, true);
        ExtendedIndexSearcher indexSearcher = new ExtendedIndexSearcher(indexReader);
        indexSearcher.setSimilarity(similarityService.defaultSearchSimilarity());
        return newAcquirableResource(new ReaderSearcherHolder(indexSearcher));
    }
View Full Code Here

public class ReaderSearcherHolder implements Releasable {

    private final ExtendedIndexSearcher indexSearcher;

    public ReaderSearcherHolder(IndexReader indexReader) {
        this(new ExtendedIndexSearcher(indexReader));
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.ExtendedIndexSearcher

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.