autoCompleteReader = IndexReader.open(autoCompleteDirectory); } else { autoCompleteReader.reopen();
@Override public IndexReader reopen(IndexCommit commit) throws CorruptIndexException, IOException { return in.reopen(commit); }
public IndexReader reopen() throws CorruptIndexException, IOException { return reader.reopen(); }
@Override public IndexReader reopen() throws IOException { return this.delegate.reopen(); }
@Override public IndexReader reopen(final boolean openReadOnly) throws IOException { return this.delegate.reopen(openReadOnly); }
@Override public IndexReader reopen(final IndexCommit commit) throws IOException { return this.delegate.reopen(commit); }
public IndexReader reopen(IndexCommit commit) throws CorruptIndexException, IOException { return reader.reopen(commit); }
public IndexReader reopen(boolean openReadOnly) throws CorruptIndexException, IOException { return reader.reopen(openReadOnly); }
public IndexReader reopen(IndexWriter writer, boolean applyAllDeletes) throws CorruptIndexException, IOException { return reader.reopen(writer, applyAllDeletes); }
private IndexReader indexReader() throws CorruptIndexException, IOException { if (_reader == null) { _reader = IndexReader.open(indexDirectory(), true); // ^^^ readOnly _searcher = new IndexSearcher(_reader); } if (!_reader.isCurrent()) { _reader = _reader.reopen(); _searcher = new IndexSearcher(_reader); } return _reader; }
private void adjustSearchersAfterMerge() throws IOException { searcherLock.writeLock().lock(); try { RefreshableIndexSearcher searcher = searchers.get(0); IndexReader reader = searcher.getIndexReader().reopen(); searcher.getIndexReader().close(); searcher.close(); searchers.set(0, new RefreshableIndexSearcher(reader)); for(int i = 0; i < numShards; i++) { //first seacher is master searcher, we do not remove it searchers.remove(1); } }finally { searcherLock.writeLock().unlock(); } }
@Override public SolrIndexReader reopen(boolean openReadOnly) throws IOException { IndexReader r = in.reopen(openReadOnly); if (r == in) { return this; } SolrIndexReader sr = new SolrIndexReader(r, null, 0); sr.associateInfo(this); return sr; }
private synchronized List<RefreshableIndexSearcher> getReadSession() { /** refresh the searcher, index might have been modified by the writers **/ for(int i = 1; i < searchers.size(); i++) { RefreshableIndexSearcher searcher = searchers.get(i); IndexReader reader =searcher.getIndexReader(); try { if(!reader.isCurrent()) { reader =reader.reopen(); searcher.stale = true; searcher = new RefreshableIndexSearcher(reader); searchers.set(i, searcher); } searcher.useCount++; } catch (Exception e) { LoggingUtil.info("number of readers = " + searchers.size()); throw new SearchException("Error while reopening the searchers, this instance" + "of Searching map may not work as expected, better to shutdown it and start afresh", e); } } return searchers; }
protected IndexReader openIndexReader() throws CorruptIndexException, IOException { if (indexReader == null) { indexReader = nrtMode ? IndexReader.open(indexWriter, true) : IndexReader.open(indexDir, true); maxTopDocuments = (int) ((float) indexReader.maxDoc() * MAX_HITS_RATIO); if (maxTopDocuments < MIN_MAX_HITS) { maxTopDocuments = MIN_MAX_HITS; } } else if (nrtMode) { indexReader = indexReader.reopen(); } return indexReader; }
/** * {@inheritDoc} */ public synchronized boolean refresh() { try { boolean updated = this.fieldManager.refresh(); IndexReader oldReader = this.indexReader; this.indexReader = this.indexReader.reopen(); if (this.indexReader != oldReader) { getLogger().debug("search-index has changed and search-engine is refreshed!"); Searcher oldSearcher = this.searcher; this.searcher = new IndexSearcher(this.indexReader); try { oldSearcher.close(); } finally { oldReader.close(); } updated = true; } this.queryBuilder.refresh(); return updated; } catch (IOException e) { throw new RuntimeIoException(e, IoMode.READ); } }
private void innerRefreshIfNeeded() throws IOException { if (flushRequired) { if (indexWriter != null) { indexWriter.commit(); } if (indexReader == null) { indexReader = IndexReader.open(directory, true); indexSearcher = searchEngineFactory.getLuceneIndexManager().openIndexSearcher(indexReader); } else { IndexReader tmpReader = indexReader.reopen(); if (tmpReader != indexReader) { indexReader.close(); indexSearcher.close(); indexReader = tmpReader; indexSearcher = searchEngineFactory.getLuceneIndexManager().openIndexSearcher(tmpReader); } } flushRequired = false; } } }
/** * {@inheritDoc} */ public IndexReader getIndexReader() throws IndexException { try { if (this.indexReader == null) { this.indexReader = IndexReader.open(this.indexDirectiry); } else if (!this.indexReader.isCurrent()) { this.indexReader = this.indexReader.reopen(); } } catch (final CorruptIndexException e) { throw new IndexException(e.getLocalizedMessage(), e); } catch (final IOException e) { throw new IndexException(e.getLocalizedMessage(), e); } return this.indexReader; }
/** * @throws IndexException * @see org.xcmis.search.lucene.AbstractLuceneQueryableIndexStorage#getIndexReader() */ @Override protected IndexReader getIndexReader() throws IndexException { try { // reopen if need if (this.indexReader == null) { this.indexReader = IndexReader.open(this.ramDirectory); } else if (!this.indexReader.isCurrent()) { this.indexReader = this.indexReader.reopen(); } } catch (CorruptIndexException e) { throw new IndexException(e.getLocalizedMessage(), e); } catch (IOException e) { throw new IndexException(e.getLocalizedMessage(), e); } return indexReader; }
this.indexReader = this.indexReader.reopen();