title: How to load an FSdirectory index file as a RAMdirectory in Lucene?
body: <p>I have an index file in hard as FSdirectory which size is about 2GB. I want to load it in ram to have a better search speed. I use the code behind:</p>
  
  <pre><code>Directory dic=new RAMDirectory(FSDirectory.open(new File("file path")), IOContext.DEFAULT);
  </code></pre>
  
  <p>But I'm not sure if it work. Do anyone know that it work or not? Any other way better than this on?</p>
  
  <p>I'll be glad of any suggestion.Thanks.</p>