public synchronized void open ( CveDB cve , Settings settings ) throws IndexException { if ( INSTANCE . usageCount . addAndGet ( 1 ) == 1 ) { try { final File temp = settings . getTempDirectory ( ) ; index = new MMapDirectory ( temp . toPath ( ) ) ; buildIndex ( cve ) ; indexReader = DirectoryReader . open ( index ) ; } catch ( IOException ex ) { throw new IndexException ( ex ) ; } indexSearcher = new IndexSearcher ( indexReader ) ; searchingAnalyzer = createSearchingAnalyzer ( ) ; queryParser = new QueryParser ( Fields . DOCUMENT_KEY , searchingAnalyzer ) ; } }
Creates and loads data into an in memory index .