如何使用卢克打开elasticsearch索引?
我用elasticsearch 1.1到1.2从3.5到4.8尝试过,但似乎没有什么效果。
唯一似乎适用的资源是http://rosssimpson.com/blog/2014/05/06/using-luke-with-elasticsearch/,但不幸的是,它没有工作。
发布于 2015-04-15 19:48:06
卢克现在支持ElasticSearch1.5.0:https://github.com/DmitryKey/luke (从主或者使用https://github.com/DmitryKey/luke/releases/tag/luke-4.10.4-field-reconstruction构建)。
发布于 2014-08-01 11:21:23
我没有在任何其他版本中尝试过它,但是它似乎适用于Luke4.9和elasticsearch版本1.3.1 (ElasticSearch 1.3.x在下面使用Lucene4.9)
在命令行中,请执行:
git clone https://github.com/DmitryKey/luke.git或者简单地下载卢克-4.9.0版本的源代码。接下来,编辑pom.xml文件并添加以下依赖项:
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.3.1</version>
</dependency>在命令行上再次执行以下操作:
cd luke
mvn install这应该使用一个名为luke-with-deps.jar.的文件创建一个目标目录。在任何归档管理器中打开该文件,编辑META-INF/services/org.apache.lucene.codecs.PostingsFormat文件,如http://rosssimpson.com/blog/2014/05/06/using-luke-with-elasticsearch/所述,并添加以下行
org.elasticsearch.index.codec.postingsformat.BloomFilterPostingsFormat
org.elasticsearch.index.codec.postingsformat.Elasticsearch090PostingsFormat
org.elasticsearch.search.suggest.completion.Completion090PostingsFormat保存此代码,您应该能够使用luke.bat或luke.sh运行路克。现在您可以在/indexname/0/ index /打开索引。如果您的elasticsearch集群中有多个碎片(缺省值为5),您可能不会看到集群中的所有文档,但可能只看到其中的一部分。只有当index.number_of_shards设置为1时,您才能看到所有文档。
发布于 2014-10-15 07:10:13
我成功地通过ElasticSearch 1.3.4打开了一个索引(它在幕后使用Lucene4.9.1)。我也遵循了罗斯·辛普森的博客中的说明,但没有起作用。正如他所说的,我在ElasticSearch中添加了pom.xml依赖项(在我的例子中是1.3.4版本)
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.3.4</version>
</dependency>并在pom.xml中设置Lucene版本(在我的例子中为4.9.1)
<lucene.version>4.9.1</lucene.version>我将jar中的META-INF/services/org.apache.lucene.codecs.PostingsFormat更新如下:
org.apache.lucene.codecs.lucene40.Lucene40PostingsFormat
org.apache.lucene.codecs.lucene41.Lucene41PostingsFormat
org.elasticsearch.index.codec.postingsformat.BloomFilterPostingsFormat
org.elasticsearch.index.codec.postingsformat.Elasticsearch090PostingsFormat
org.elasticsearch.search.suggest.completion.Completion090PostingsFormat到目前为止,说明与博客文章中的相同。我采取的其他步骤是更新META-INF/services/org.apache.lucene.codecs.Codec添加最后一行(在打开名为Lucene49的编解码器没有找到的索引时,我得到了一个异常):
org.apache.lucene.codecs.simpletext.SimpleTextCodec
org.apache.lucene.codecs.appending.AppendingCodec
org.apache.lucene.codecs.lucene49.Lucene49Codechttps://stackoverflow.com/questions/24233193
复制相似问题