Class SearcherFactory


  • public class SearcherFactory
    extends java.lang.Object
    Factory class used by SearcherManager to create new IndexSearchers. The default implementation just creates an IndexSearcher with no custom behavior:
       public IndexSearcher newSearcher(IndexReader r) throws IOException {
         return new IndexSearcher(r);
       }
     
    You can pass your own factory instead if you want custom behavior, such as:
    • Constructor Detail

      • SearcherFactory

        public SearcherFactory()
    • Method Detail

      • newSearcher

        public IndexSearcher newSearcher​(IndexReader reader)
                                  throws java.io.IOException
        Returns a new IndexSearcher over the given reader.
        Throws:
        java.io.IOException