Embedded solr with third party libraries

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Embedded solr with third party libraries

Darniz
Hi
We are having issue running our test cases with third party library for embedded solr.
For exampel we are using kstem library which is not a part of solr distirbution. When we run test cases our schema.xml has defintion for lucid kstem and it throws ClassNotFound Exception.
We declared the depency for the two jars lucid-kstem.jar and lucid-solr-kstem.jar but still it throws an error.

Till now whenever we have to run embedded solr we manually copy all the config files like schema.xml, solrConfig.xml to a temp directory which is considered solr home and its generally under the user home directory which will copy all config files to user_home/solr/conf/directory. below is the example

C:\DOCUME~1\username\LOCALS~1\Temp\solr-all\0.8194571792905493\solr\conf\schema.xml

Now in order for the jar to be loaded should i copy the two jars to solr/lib directory. is that the default location embedded solr looks into for some default jars.

Any advice.



 






Reply | Threaded
Open this post in threaded view
|

Re: Embedded solr with third party libraries

hossman

: distirbution. When we run test cases our schema.xml has defintion for lucid
: kstem and it throws ClassNotFound Exception.
: We declared the depency for the two jars lucid-kstem.jar and
: lucid-solr-kstem.jar but still it throws an error.

explain what you mean by "declared the depency" ?

: C:\DOCUME~1\username\LOCALS~1\Temp\solr-all\0.8194571792905493\solr\conf\schema.xml
:
: Now in order for the jar to be loaded should i copy the two jars to solr/lib
: directory. is that the default location embedded solr looks into for some
: default jars.

assuming "C:\DOCUME~1\username\LOCALS~1\Temp\solr-all\0.8194571792905493\solr"
is your sole home dir, then yes you can copy your jars into
"C:\DOCUME~1\username\LOCALS~1\Temp\solr-all\0.8194571792905493\solr\lib"
and that should work ... or starting in Solr 1.4 you can use the <lib>
directorives to specify a jar anywhere on disk.  see the example
solrconfig.xml for the syntax.



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Embedded solr with third party libraries

Lance Norskog-2
To deploy the Lucid KStem stemmer, copy these two files:
        lucid-kstem.jar
        lucid-solr-kstem.jar
to the lib/ directory in your running solr instance.

In the <fieldType> declaration for a text field, you would change this line:
        <filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt" />
to this:
        <filter
class="com.lucidimagination.solrworks.analysis.LucidKStemFilterFactory"
protected="protwords.txt"/>

(Remember that you have to make this change in both the query and
analysis sections of the fieldType specification.)

Now, to verify the change, restart solr and go to the analysis.jsp test page:
http://localhost:8983/solr/admin/analysis.jsp

Let's say you changed the 'text' type and left 'textTight' using
PorterStemmer. Change the Field name/type drop-down to 'type' and type
'text' in the top box. Now type 'changing' in the "Field Value" box
and click 'Analyze'. The bottom of the page will now show that
'changeing' was stemmed to 'change'. If you change the field type from
'text' to 'textTight' and try again, 'changing' will be stemmed to
'chang' by the original PorterStemmer.

On Mon, Nov 23, 2009 at 12:23 PM, Chris Hostetter
<[hidden email]> wrote:

>
> : distirbution. When we run test cases our schema.xml has defintion for lucid
> : kstem and it throws ClassNotFound Exception.
> : We declared the depency for the two jars lucid-kstem.jar and
> : lucid-solr-kstem.jar but still it throws an error.
>
> explain what you mean by "declared the depency" ?
>
> : C:\DOCUME~1\username\LOCALS~1\Temp\solr-all\0.8194571792905493\solr\conf\schema.xml
> :
> : Now in order for the jar to be loaded should i copy the two jars to solr/lib
> : directory. is that the default location embedded solr looks into for some
> : default jars.
>
> assuming "C:\DOCUME~1\username\LOCALS~1\Temp\solr-all\0.8194571792905493\solr"
> is your sole home dir, then yes you can copy your jars into
> "C:\DOCUME~1\username\LOCALS~1\Temp\solr-all\0.8194571792905493\solr\lib"
> and that should work ... or starting in Solr 1.4 you can use the <lib>
> directorives to specify a jar anywhere on disk.  see the example
> solrconfig.xml for the syntax.
>
>
>
> -Hoss
>
>



--
Lance Norskog
[hidden email]