Reopens the index search reader for this index, required after the index has been changed.<p>

@see #indexSearcherOpen(String)
351554
protected synchronized void indexSearcherUpdate() {

        IndexSearcher oldSearcher = m_indexSearcher;
        if ((oldSearcher != null) && (oldSearcher.getIndexReader() != null)) {
            // in case there is an index searcher available close it
            try {
                if (oldSearcher.getIndexReader() instanceof DirectoryReader) {
                    IndexReader newReader = DirectoryReader.openIfChanged(
                        (DirectoryReader)oldSearcher.getIndexReader());
                    if (newReader != null) {
                        m_indexSearcher = new IndexSearcher(newReader);
                        m_indexSearcher.setSimilarity(m_sim);
                        indexSearcherClose(oldSearcher);
                    }
                }
            } catch (Exception e) {
                LOG.error(Messages.get().getBundle().key(Messages.ERR_INDEX_SEARCHER_REOPEN_1, getName()), e);
            }
        } else {
            // make sure we end up with an open index searcher / reader
            indexSearcherOpen(getPath());
        }
    }
433049
public void open(final OperationResult<Void, Exception> onOpen, final OperationResult<Void, Exception> onClose) {

        this.onOpen = onOpen;
        this.onClose = onClose;
        this.sendLink.open();
        this.receiveLink.open();
    }
799622
@Override
  public MtasSpanQuery rewrite(IndexReader reader) throws IOException {
    MtasSpanQuery newQ1 = (MtasSpanQuery) q1.rewrite(reader);
    MtasSpanQuery newQ2 = (MtasSpanQuery) q2.rewrite(reader);
    if (newQ1 == null || newQ1 instanceof MtasSpanMatchNoneQuery
        || newQ2 == null || newQ2 instanceof MtasSpanMatchNoneQuery) {
      return new MtasSpanMatchNoneQuery(field);
    } else if (!newQ1.equals(q1) || !newQ2.equals(q2)) {
      return new MtasSpanFullyAlignedWithQuery(newQ1, newQ2).rewrite(reader);
    } else if (newQ1.equals(newQ2)) {
      return newQ1;
    } else {
      boolean returnNone;
      returnNone = newQ1.getMaximumWidth() != null
          && newQ1.getMaximumWidth() == 0;
      returnNone |= newQ2.getMaximumWidth() != null
          && newQ2.getMaximumWidth() == 0;
      returnNone |= newQ1.getMinimumWidth() != null
          && newQ2.getMaximumWidth() != null
          && newQ1.getMinimumWidth() > newQ2.getMaximumWidth();
      returnNone |= newQ2.getMinimumWidth() != null
          && newQ1.getMaximumWidth() != null
          && newQ2.getMinimumWidth() > newQ1.getMaximumWidth();
      returnNone |= newQ2.getMinimumWidth() != null
          && newQ1.getMaximumWidth() != null
          && newQ2.getMinimumWidth() > newQ1.getMaximumWidth();
      if (returnNone) {
        return new MtasSpanMatchNoneQuery(this.getField());
      } else {
        return super.rewrite(reader);
      }
    }
  }
906840
void resetHead(long index) {
    for (SegmentedJournalReader reader : readers) {
      if (reader.getNextIndex() < index) {
        reader.reset(index);
      }
    }
  }
52885
public void repairIndex() throws IOException {
        byte[] currentLargestKey = new byte[keySize];
        int maxChunk = getChunkIndex(getFilledUpFromContentStart());
        for (int currentChunkId = 0; currentChunkId <= maxChunk; currentChunkId++) {
            long currentOffset = (currentChunkId + 1) * getChunkSize() - elementSize;
            if (currentOffset < getFilledUpFromContentStart()) {
                read(currentOffset, currentLargestKey);
            } else {
                read(getFilledUpFromContentStart() - elementSize, currentLargestKey);
            }
            getIndex().setLargestKey(currentChunkId, currentLargestKey);
        }
    }
752369
@Override
  public MtasSpanQuery rewrite(IndexReader reader) throws IOException {
    MtasSpanQuery newClause = clause.rewrite(reader);
    if (!newClause.equals(clause)) {
      return new MtasSpanUniquePositionQuery(newClause).rewrite(reader);
    } else {
      return super.rewrite(reader);
    }
  }
209979
public void rebuildIndexes(List<String> indexNames, I_CmsReport report) throws CmsException {

        try {
            SEARCH_MANAGER_LOCK.lock();
            Iterator<String> i = indexNames.iterator();
            while (i.hasNext()) {
                String indexName = i.next();
                // get the search index by name
                I_CmsSearchIndex index = getIndex(indexName);
                if (index != null) {
                    // update the index
                    updateIndex(index, report, null);
                } else {
                    if (LOG.isWarnEnabled()) {
                        LOG.warn(Messages.get().getBundle().key(Messages.LOG_NO_INDEX_WITH_NAME_1, indexName));
                    }
                }
            }
            // clean up the extraction result cache
            cleanExtractionCache();
        } finally {
            SEARCH_MANAGER_LOCK.unlock();
        }
    }
180326
public synchronized void onOpen() {
        if (state == State.WAITING || state == State.SCANNING)
            throw new IllegalStateException("Do not call onOpen if not closed before");
        currentDataUsed = true;
        state = State.WAITING;
    }
819010
protected synchronized void indexSearcherClose(IndexSearcher searcher) {

        // in case there is an index searcher available close it
        if ((searcher != null) && (searcher.getIndexReader() != null)) {
            try {
                searcher.getIndexReader().close();
            } catch (Exception e) {
                LOG.error(Messages.get().getBundle().key(Messages.ERR_INDEX_SEARCHER_CLOSE_1, getName()), e);
            }
        }
    }
1230241
@Override
  public MtasSpanQuery rewrite(IndexReader reader) throws IOException {
    MtasSpanQuery newQuery = query.rewrite(reader);
    if (maximumRecurrence == 1) {
      return newQuery;
    } else {
      MtasSpanQuery newIgnoreQuery = (ignoreQuery != null)
          ? ignoreQuery.rewrite(reader) : null;
      if (newQuery instanceof MtasSpanRecurrenceQuery) {
        // for now too difficult, possibly merge later
      }
      if (!newQuery.equals(query)
          || (newIgnoreQuery != null && !newIgnoreQuery.equals(ignoreQuery))) {
        return new MtasSpanRecurrenceQuery(newQuery, minimumRecurrence,
            maximumRecurrence, newIgnoreQuery, maximumIgnoreLength)
                .rewrite(reader);
      } else {
        return super.rewrite(reader);
      }
    }
  }
1002870
protected void releaseWriterAndReaders()
   {
      if (indexWriter != null)
      {
         try
         {
            indexWriter.close();
         }
         catch (IOException e)
         {
            log.warn("Exception closing index writer: " + e.toString());
         }
         indexWriter = null;
      }
      if (indexReader != null)
      {
         try
         {
            indexReader.close();
         }
         catch (IOException e)
         {
            log.warn("Exception closing index reader: " + e.toString());
         }
         indexReader = null;
      }
      if (readOnlyReader != null)
      {
         try
         {
            readOnlyReader.release();
         }
         catch (IOException e)
         {
            log.warn("Exception closing index reader: " + e.toString());
         }
         readOnlyReader = null;
      }
      if (sharedReader != null)
      {
         try
         {
            sharedReader.release();
         }
         catch (IOException e)
         {
            log.warn("Exception closing index reader: " + e.toString());
         }
         sharedReader = null;
      }
   }
607443
@SuppressWarnings("unused")
    private Object readResolve() {
        if (StringUtils.isNotEmpty(oldTopic)) {
            oldTopicObject = new Topic(oldTopic);
            oldTopic = null;
        }

        if (oldTopicObject != null && StringUtils.isEmpty(oldTopicObject.getName())) {
            oldTopicObject = null;
        }

        return this;
    }
999735
@Override
  public MtasSpanQuery rewrite(IndexReader reader) throws IOException {
    MtasSpanQuery newQ1 = (MtasSpanQuery) q1.rewrite(reader);
    MtasSpanQuery newQ2 = (MtasSpanQuery) q2.rewrite(reader);
    if (!newQ1.equals(q1) || !newQ2.equals(q2)) {
      return new MtasSpanIntersectingQuery(newQ1, newQ2).rewrite(reader);
    } else if (newQ1.equals(newQ2)) {
      return newQ1;
    } else {

      boolean returnNone;
      returnNone = newQ1.getMaximumWidth() != null
          && newQ1.getMaximumWidth() == 0;
      returnNone |= newQ2.getMaximumWidth() != null
          && newQ2.getMaximumWidth() == 0;
      if (returnNone) {
        return new MtasSpanMatchNoneQuery(this.getField());
      } else {
        return super.rewrite(reader);
      }
    }
  }
1276362
void store(IndexReader reader, String field, String prefix, ValueIndex value)
   {
      synchronized (cache)
      {
         Map<Key, ValueIndex> readerCache = cache.get(reader);
         if (readerCache == null)
         {
            readerCache = new HashMap<Key, ValueIndex>();
            cache.put(reader, readerCache);
         }
         readerCache.put(new Key(field, prefix), value);
      }
   }
1340207
private void initializeSearchTextListener() {
    searchText.addListener((observable, oldText, newText) -> {
      if (newText.equals("")) { // empty search -> doesn't match anything!
        resetSearch();
      } else {
        updateSearch(newText);
      }
    });
  }
34708
public MtasSpanSequenceItem rewrite(IndexReader reader) throws IOException {
    MtasSpanQuery newSpanQuery = spanQuery.rewrite(reader);
    if (!newSpanQuery.equals(spanQuery)) {
      return new MtasSpanSequenceItem(newSpanQuery, optional);
    } else {
      return this;
    }
  }
483597
@Override
	public void load(final Reader reader) throws IOException {
		lock.writeLock().lock();
		try {
			properties.load(reader);
		} finally {
			lock.writeLock().unlock();
		}
	}