Class LoadSearcherRequest


  • public class LoadSearcherRequest
    extends java.lang.Object
    A class to streamline the creation of a VersatileSearcher.
    • Constructor Summary

      Constructors 
      Constructor Description
      LoadSearcherRequest​(java.lang.String indexDir, java.lang.String lshVecDir, boolean loadToRAM)  
    • Constructor Detail

      • LoadSearcherRequest

        public LoadSearcherRequest​(java.lang.String indexDir,
                                   java.lang.String lshVecDir,
                                   boolean loadToRAM)
        Parameters:
        indexDir -
        lshVecDir -
        loadToRAM - Note that setting loadToRAM = true is only necessary as a warm-up step to speed up searcher. Usually after running a few queries with an in-RAM searcher we should close and then use a non-RAM searcher on the same index. The new searcher will always outperform the in-RAM one due to caching mechanism while also consumes less memory. You can also use a non-RAM searcher from the start and let the operation system eventually caches your index file but this usually takes a longer time than using a in-RAM searcher first. Plus doing so means that the first dozens (or hundreds) queries will be very slow.
    • Method Detail

      • getSearcher

        public VersatileSearcher getSearcher()
                                      throws java.io.IOException
        Throws:
        java.io.IOException