当前位置: 动力学知识库 > 问答 > 编程问答 >

groovy - How to run solr 4.4 through gradle?

问题描述:

I am having some trouble with running solr as a gradle task . Example from https://github.com/fhopf/solr-facet-example/blob/master/build.gradle shows running of solr 4.0 but I want to run it through solr 4.4 . I have done configurations as

configurations {

solrWebApp

}

dependencies {

solrWebApp "org.apache.solr:solr:[email protected]"

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

My solr_home points to the core having lucene version 4.4 too, but error message shows .

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

My solr home has lucene4.4

Can anyone help me out with this ?

网友答案:

Did you by any chance upgrade from previous Solr distribution? In which case, you may have old files lying around, such as unpacked webapp directory that comes from war file in the distribution. You may need to delete those, run Solr from command line once and try again.

分享给朋友:
您可能感兴趣的文章:
随机阅读: