2014-06-15 49 views

回答

1

我还没有与任何其他版本尝试过,但似乎与卢克4.9和elasticsearch版本1.3.1工作(ElasticSearch 1.3.x中使用的Lucene 4.9的下面)

在命令行中执行:

git clone https://github.com/DmitryKey/luke.git 

或简单地下载luke-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 /服务上http://rosssimpson.com/blog/2014/05/06/using-luke-with-elasticsearch/描述/ org.apache.lucene.codecs.PostingsFormat,并添加以下行

org.elasticsearch.index.codec.postingsformat.BloomFilterPostingsFormat 
org.elasticsearch.index.codec.postingsformat.Elasticsearch090PostingsFormat 
org.elasticsearch.search.suggest.completion.Completion090PostingsFormat 

保存这一点,你应该能够运行卢克使用luke.batluke.sh。 例如,您现在可以在/ indexname/0/index /处打开索引。 如果您的elasticsearch集群中有多个分区(默认值为5),则可能无法看到该集群中的所有文档,但只能看到其中的一部分。只有在index.number_of_shards设置为1时,您才能看到所有文档。

1

我成功地通过ElasticSearch 1.3.4(其使用Lucene 4.9.1)打开索引。我也按照Ross Simpson's blog中的说明操作,但没有奏效。在pom.xml

<dependency> 
    <groupId>org.elasticsearch</groupId> 
    <artifactId>elasticsearch</artifactId> 
    <version>1.3.4</version> 
</dependency> 

而且还设置了Lucene的版本(在我的情况4.9.1):正如他所说,我在pom.xml添加ElasticSearch依赖(对我来说版本1.3.4)

<lucene.version>4.9.1</lucene.version> 

我更新如下罐子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.Lucene49Codec