我们可以像使用 Lucene 一样在磁盘上存储 ElasticSearch 索引(无需安装服务)吗?
我们能这么简单吗?
...
File indexDir = new File(INDEX_DIRECTORY);
Directory directory = FSDirectory.open(indexDir);
Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_35);
IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_35, analyzer);
IndexWriter writer = new IndexWriter(directory, conf);
...
如果是,那么如何实施?