Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.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
将Solr 1.4索引文件迁移到4.7_Solr_Lucene_Solr4 - Fatal编程技术网

将Solr 1.4索引文件迁移到4.7

将Solr 1.4索引文件迁移到4.7,solr,lucene,solr4,Solr,Lucene,Solr4,在Solr4.7中为旧的1.4索引创建新集合时,我遇到了很多问题。最后,我坚持以下问题: 创建SolrCore“NewArchive4”时出错:无法创建核心: NewArchive4原因:不支持格式版本(资源: MMapIndexInput(path=“E:\news archive\data\news archive\index_4p.fdx”): 1(需要介于2和3之间)。此版本的Lucene仅支持 使用3.0版及更高版本创建的索引 如何优化或更新索引文件以与Solr 4.7兼容 我没有任

在Solr4.7中为旧的1.4索引创建新集合时,我遇到了很多问题。最后,我坚持以下问题:

创建SolrCore“NewArchive4”时出错:无法创建核心: NewArchive4原因:不支持格式版本(资源: MMapIndexInput(path=“E:\news archive\data\news archive\index_4p.fdx”): 1(需要介于2和3之间)。此版本的Lucene仅支持 使用3.0版及更高版本创建的索引

如何优化或更新索引文件以与Solr 4.7兼容

我没有任何文档的xml文件,它只是dataDir中的文件

编辑 我在femtoRgon comment中尝试了该解决方案,但它返回以下错误:

E:\solr-new\example\solr-webapp\webapp\WEB-INF\lib>java -cp lucene-core-4.7.2.jar org.apache.lucene.ind
ex.IndexUpgrader -delete-prior-commits -verbose E:\news-archive\data\newsarchive\index
IW 0 [Fri Aug 22 19:59:03 CEST 2014; main]: init: hit exception on init; releasing write lock
Exception in thread "main" org.apache.lucene.index.IndexFormatTooOldException: Format version is not su
pported (resource: MMapIndexInput(path="E:\news-archive\data\newsarchive\index\_4p.fdx")): 1 (needs to
be between 2 and 3). This version of Lucene only supports indexes created with release 3.0 and later.
        at org.apache.lucene.codecs.lucene3x.Lucene3xStoredFieldsReader.checkCodeVersion(Lucene3xStored
FieldsReader.java:120)
        at org.apache.lucene.codecs.lucene3x.Lucene3xSegmentInfoReader.readLegacyInfos(Lucene3xSegmentI
nfoReader.java:74)
        at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:369)
        at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:404)
        at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:843)
        at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:694)
        at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:400)
        at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:746)
        at org.apache.lucene.index.IndexUpgrader.upgrade(IndexUpgrader.java:161)
        at org.apache.lucene.index.IndexUpgrader.main(IndexUpgrader.java:74)
E:\solr new\example\solr webapp\webapp\WEB-INF\lib>java-cp lucene-core-4.7.2.jar org.apache.lucene.ind
ex.IndexUpgrader-删除以前的提交-详细E:\news archive\data\news archive\index
IW 0[Fri Aug 22 19:59:03 CEST 2014;main]:初始化:初始化时命中异常;释放写锁
线程“main”org.apache.lucene.index.IndexFormatToolDexception中出现异常:格式版本不是su
支持(资源:MMapIndexInput(path=“E:\news archive\data\newsarchive\index\\u 4p.fdx”):1(需要
介于2和3之间)。此版本的Lucene仅支持使用3.0版及更高版本创建的索引。
在org.apache.lucene.codecs.lucene3x.lucene3xstoredfeldsreader.checkCodeVersion(Lucene3xStored
FieldsReader.java:120)
在org.apache.lucene.codecs.lucene3x.Lucene3xSegmentInfoReader.readLegacyInfos(Lucene3xSegmentI
nforeder.java:74)
位于org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:369)
位于org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:404)
在org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:843)上
位于org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:694)
位于org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:400)
位于org.apache.lucene.index.IndexWriter(IndexWriter.java:746)
位于org.apache.lucene.index.IndexUpgrader.upgrade(IndexUpgrader.java:161)
位于org.apache.lucene.index.IndexUpgrader.main(IndexUpgrader.java:74)

Lucene 4.X似乎不再支持读取1.X。为了升级它,我相信您需要将其分为两步,首先下载Lucene 3.x,然后使用它进行升级(使用)


一旦你有了Lucene 3格式的索引,你应该能够阅读并升级到4.7版本。

你可以试试Lucene的@femtoRgon,请检查问题的编辑。@sєm sєm正如femtoRgon在问题中所写;您的IndexUpgrader版本太新。您必须获取一个旧版本(否则Solr将为您执行此操作,因为如果可能,它将升级索引文件)。我从Solr3.1开始,这个方法在它的api中不存在。我也得到了同样的错误。显然,您也不能将索引从4.0迁移到4.7。