0

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: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

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 ?

tim_yates
  • 167,322
  • 27
  • 342
  • 338
89n3ur0n
  • 921
  • 11
  • 24
  • Looks like this thread might help: http://stackoverflow.com/questions/17519095/invalid-lucenematchversion-lucene-36. – Evgeny Chernyavskiy Sep 11 '13 at 15:26
  • Thanks Tim. I tried that with no success. I made some changes now. Instead of my new core, I used solr's default "collection1". It runs but does not show anything. You can see a similar thread here.http://forums.gradle.org/gradle/topics/run_solr_4_4_from_gradle – 89n3ur0n Sep 12 '13 at 12:13
  • possible duplicate of [Installing Apache Solr 4.3.1 on Apache Tomcat 6.0](http://stackoverflow.com/questions/17619809/installing-apache-solr-4-3-1-on-apache-tomcat-6-0) – kenorb Mar 29 '15 at 13:23

1 Answers1

0

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.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27
  • Hi Cleared my gradle cache directory and also added solr.xml file with new core configuration so that it detects the core "HelloWorld". That worked well. Solr is up. Next issue , when I run my tests through gradle it always try to find core collection1 . Dont know why ! Investigating it. – 89n3ur0n Sep 16 '13 at 11:49
  • collection1 is the default name for single-collection setup.your gradle is probably not finding your solr.xml and falls back to defaults. Which may mean incorrect configuration in other ways too. I'd check that very carefully. – Alexandre Rafalovitch Sep 17 '13 at 06:41
  • But in gradle, in think there is no way to tell to pick up solr.xml when it starts solr. Is there ? – 89n3ur0n Sep 18 '13 at 07:44
  • was my mistake of getting previous version getting mixed up from other installation. Will close it uo, lying here around for more than a year – 89n3ur0n Mar 30 '15 at 06:54