【发布时间】:2013-09-11 10:37:55
【问题描述】:
我在将 solr 作为 gradle 任务运行时遇到了一些问题。 https://github.com/fhopf/solr-facet-example/blob/master/build.gradle 的示例显示了 solr 4.0 的运行,但我想通过 solr 4.4 运行它。我已经完成了配置
configurations {
solrWebApp
}
dependencies {
solrWebApp "org.apache.solr:solr:4.4.0@war"
testCompile "junit:junit:4.10"
testCompile "org.apache.solr:solr-test-framework:4.4.0"
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.+'
}
jettyRun.webAppSourceDirectory = file("webapp")
task runSolr(type: JettyRunWar) {
webApp = configurations.solrWebApp.singleFile
}
//currently this points to solr 4.0 , should be configured to use solr 4.4
runSolr.doFirst {
System.setProperty("solr.solr.home", "/opt/solr_home")
}
httpPort = 8080
stopPort = 9451
我的solr_home 也指向具有 lucene 版本 4.4 的核心,但显示错误消息。
Unable to create core: helloworld
org.apache.solr.common.SolrException: Invalid luceneMatchVersion '4.4', valid values are: [LUCENE_30, LUCENE_31, LUCENE_32, LUCENE_33, LUCENE_34, LUCENE_35, LUCENE_36, LUCENE_40, LUCENE_CURRENT] or a string in format 'V.V'
---------------
Caused by: java.lang.IllegalArgumentException: No enum const class org.apache.lucene.util.Version.LUCENE_44
at java.lang.Enum.valueOf(Enum.java:214)
at org.apache.lucene.util.Version.valueOf(Version.java:34)
at org.apache.lucene.util.Version.parseLeniently(Version.java:119)
at org.apache.solr.core.Config.parseLuceneVersionString(Config.java:311)
... 130 more
我的solr家有lucene4.4
谁能帮我解决这个问题?
【问题讨论】:
-
看起来这个帖子可能会有所帮助:stackoverflow.com/questions/17519095/….
-
谢谢蒂姆。我试过没有成功。我现在做了一些改变。我没有使用我的新内核,而是使用了 solr 的默认“collection1”。它运行但不显示任何内容。你可以在这里看到一个类似的线程。forums.gradle.org/gradle/topics/run_solr_4_4_from_gradle