Hi RichSimon,

In short: Solr is only compatible to the version it is shipped with (or the 
other minor patch levels). So Solr 1.4 works with Lucene 2.9, so you must have 
any Lucene 2.9.x in your classpath.
Lucene 3.0 is a major release of Lucene and had removed all backwards 
compatibility layers, that are still existent in Lucene 2.9 (functionality is 
identical in 2.9 and 3.0). Unfortunately, Solr 1.4 still used some of the 
deprecated code, so it's not compatible.

About one year ago, Lucene and Solr merged to one Apache project and now Lucene 
and Solr is released together with same version number. The latest Lucene and 
Solr release in 3.1. But again, Solr should only be used with the version it is 
shipped with. There was never a separate release of Solr for Lucene 3.0, you 
can only upgrade or downgrade.

matchVersion parameters have less to do with API compatibility (sometimes it is 
used also for that to keep backwards), but it's more used to control behavior 
of some analyzers (means how text tokenization is done to make analysis 
compatible between different versions). 

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


> -----Original Message-----
> From: RichSimon [mailto:richard_si...@hms.harvard.edu]
> Sent: Monday, April 11, 2011 4:37 PM
> To: solr-...@lucene.apache.org
> Subject: Solr 1.4.1 compatible with Lucene 3.0.1?
> 
> 
> Short story: I am using Lucene 3.0.1, and I'm trying to run Solr 1.4.1. I get 
> an
> error starting the embedded Solr server that says it cannot find the method
> FSDirectory.getDirectory. The release notes for Solr 1.4.1 says it is 
> compatible
> with Lucene 2.9.3, and I see that Lucene 3.0.1 does not have the
> FSDirectory.getDirectory method any more. Dorwngrading Lucene to 2.9.x is
> not an option for me. What version of Solr should I use for Lucene 3.0.1?
> (We're just starting with Solr, so changing that version is not hard.) Or, do 
> I
> have to upgrade both Solr and Lucene?
> 
> Thanks,
> 
> -Rich
> 
> Here's the long story:
> I am using Lucene 3.0.1, and I'm trying to run Solr 1.4.1. I have not used any
> other version of Lucene. We have an existing project using Lucene 3.0.1, and
> we want to start using Solr. When I try to initialize an embedded Solr server,
> like so:
> 
> 
>               String solrHome = PATH_TO_SOLR_HOME;
>               File home = new File(solrHome);
>               File solrXML = new File(home, "solr.xml");
> 
>               coreContainer = new CoreContainer();
>               coreContainer.load(solrHome, solrXML);
> 
>                       embeddedSolr = new
> EmbeddedSolrServer(coreContainer, SOLR_CORE);
> 
> 
> 
> [04-08 11:48:39] ERROR CoreContainer [main]:
> java.lang.NoSuchMethodError:
> org.apache.lucene.store.FSDirectory.getDirectory(Ljava/lang/String;)Lorg/ap
> ache/lucene/store/FSDirectory;
> at
> org.apache.solr.spelling.AbstractLuceneSpellChecker.initIndex(AbstractLuce
> neSpellChecker.java:186)
>       at
> org.apache.solr.spelling.AbstractLuceneSpellChecker.init(AbstractLuceneSpe
> llChecker.java:101)
>       at
> org.apache.solr.spelling.IndexBasedSpellChecker.init(IndexBasedSpellCheck
> er.java:56)
>       at
> org.apache.solr.handler.component.SpellCheckComponent.inform(SpellChe
> ckComponent.java:274)
>       at
> org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:50
> 8)
>       at org.apache.solr.core.SolrCore.(SolrCore.java:588)
>       at
> org.apache.solr.core.CoreContainer.create(CoreContainer.java:428)
>       at org.apache.solr.core.CoreContainer.load(CoreContainer.java:278)
> 
> 
> Looking at Google posts about this, it seemed that this can be caused by a
> version mismatch between the Lucene version in use and the one Solr tries
> to use. I noticed a Lucene version tag in the example solrconfig.xml that I’m
> modifying:
> 
>   LUCENE_40
> 
> I changing it to LUCENE_301, changing it to LUCENE_30, and commenting it
> out, but I still get the same error. Using
> LucenePackage.get().getImplementationVersion() shows this as the Lucene
> version:
> 
> Lucene version: 3.0.1 912433 - 2010-02-21 23:51:22
> 
> I also printed my classpath and found the following lucene jars:
> lucene-analyzers-3.0.1.jar
> lucene-core-3.0.1.jar
> lucene-highlighter-3.0.1.jar
> lucene-memory-3.0.1.jar
> lucene-misc-2.9.3.jar
> lucene-queries-2.9.3.jar
> lucene-snowball-2.9.3.jar
> lucene-spellchecker-2.9.3.jar
> 
> The FSDirectory class is in lucene-core. I decompiled the class file in the 
> jar,
> and did not see a getDirectory method. Also, I used a ClassLoader statement
> to get an instance of the FSDirectory class my code is using, and printed out
> the methods; no getDirectory method.
> 
> I gather from the Lucene Javadoc that the getDirectory method is in
> FSDirectory for 2.4.0 and for 2.9.0, but is gone in 3.0.1 (the version I'm 
> using).
> 
> Is Lucene 3.0.1 completely incompatible with Solr 1.4.1? Is there some way to
> use the luceneMatchVersion tag to tell Solr what version I want to use?
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-1-4-
> 1-compatible-with-Lucene-3-0-1-tp2806828p2806828.html
> Sent from the Solr - Dev mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional
> commands, e-mail: dev-h...@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to