我可以直接在文件系统中存储ElasticSearch索引吗?

时间:2019-03-29 07:37:15

标签: java elasticsearch lucene

我们可以像使用 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);
...

如果是,那么如何实施?

0 个答案:

没有答案