healthonnet / hon-lucene-synonyms

Solr query parser plugin that performs proper query-time synonym expansion.
http://nolanlawson.com/2012/10/31/better-synonym-handling-in-solr
150 stars 67 forks source link

Adding .jar to $SOLR_HOME generates class not found exception? #62

Closed Johnb6262 closed 8 years ago

Johnb6262 commented 8 years ago

Hi - and thanks for the work on this great plugin.

I'm trying to use with Solr 5.4 and I saw the instruction that says:

Update: We have tested to run with the jar in $SOLR_HOME/lib as well, and it works (Jetty).

So, I took the defaults on the "for production" Solr install script and inside /etc/defaults/solr.in.sh my $SOLR_HOME is set to /var/solr/data. Therefore I added a /lib directory inside /data and dropped the hon-lucene-synonyms-2.0.0.jar file into /var/solr/data/lib -- then I restarted Solr.

Unfortunately I'm getting a class not found exception in the Solr logs...

Caused by: java.lang.ClassNotFoundException: com.github.healthonnet.search.SynonymExpandingExtendedDismaxQParserPlugin

Where should I put this file to work with Solr Cloud? Thanks in advance

avlukanin commented 8 years ago

Possibly you have to set $SOLR_HOME to /var/solr, because data directory is usually used for storing the index, so the lib and data directories should be inside /var/solr then.

Mykezero commented 8 years ago

Does that version use com.github.healthonnet.search.SynonymExpandingExtendedDismaxQParserPlugin or solr.SynonymExpandingExtendedDismaxQParserPlugin as the class name?

Maybe changing the class name to that will help:

<queryParser name="synonym_edismax" class="solr.SynonymExpandingExtendedDismaxQParserPlugin">
Johnb6262 commented 8 years ago

Thank you. Yes, I dug into the .jar and found it was a class or package name problem. Once I changed that and recompiled, it worked like a charm. As far as I'm concerned (if anyone cares to do so) this "ticket" could be closed... I'd do it myself, but suspect I don't have permissions...

joekiller commented 8 years ago

I have updated the README.md for the latest version. Please post any issues.