Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 弹性搜索与卢克_Java_Lucene_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Luke - Fatal编程技术网 elasticsearch,luke,Java,Lucene,elasticsearch,Luke" /> elasticsearch,luke,Java,Lucene,elasticsearch,Luke" />

Java 弹性搜索与卢克

Java 弹性搜索与卢克,java,lucene,elasticsearch,luke,Java,Lucene,elasticsearch,Luke,如何与luke一起打开elasticsearch索引 我试过luke从3.5到4.8,elasticsearch从1.1到1.2,但似乎没有任何效果 唯一似乎适用的资源是,不幸的是,它不起作用。我没有尝试过任何其他版本,但它似乎适用于luke 4.9和elasticsearch 1.3.1版(elasticsearch 1.3.x在下面使用Lucene 4.9) 在命令行上执行以下操作: git clone https://github.com/DmitryKey/luke.git 或者只需下

如何与luke一起打开elasticsearch索引

我试过luke从3.5到4.8,elasticsearch从1.1到1.2,但似乎没有任何效果


唯一似乎适用的资源是,不幸的是,它不起作用。

我没有尝试过任何其他版本,但它似乎适用于luke 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>
这将创建一个目标目录,其中包含一个名为luke with deps.jar的文件。 在任何存档管理器中打开此文件,并按中所述编辑META-INF/services/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运行luke。 例如,现在可以在/indexname/0/index/处打开索引。
如果elasticsearch集群中有多个碎片(默认值为5),则可能无法看到该集群中的所有文档,而只能看到其中的一部分。只有当index.number\u of\u shards设置为1时,您才能查看所有文档。

我已成功地通过ElasticSearch 1.3.4(在引擎盖下使用Lucene 4.9.1)打开索引。我也遵循了中的说明,但没有起作用。正如他所说,我在
pom.xml
中添加了ElasticSearch依赖项(在我的例子中是1.3.4版):

<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>1.3.4</version>
</dependency>
<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的编解码器未找到时出现异常):


Luke现在支持elasticsearch 1.5.0:(从master构建或使用)

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
org.apache.lucene.codecs.simpletext.SimpleTextCodec
org.apache.lucene.codecs.appending.AppendingCodec
org.apache.lucene.codecs.lucene49.Lucene49Codec