I would like to improve the speed of my search system, by using some features like the "Near realtime search", making faster the opening of an index.
Who can tell me what are the differences and advantages of using one or the other of the following pieces of code:
IndexReader newIndexReader = IndexReader.openIfChanged(oldReader);
and
IndexWriter writer; // create an IndexWriter here
...
IndexReader reader = writer.getReader();
Note that in the first case i don't need that the indexWriter is in the same process of the IndexReader.