You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Rose, Stuart J" <St...@pnnl.gov> on 2016/04/03 05:04:29 UTC

using custom analyzer on SolrCloud

I am trying to setup on my dev workstation a small SolrCloud in order to assess the faceting capability in Solr 5.5 and I have several questions.

First some context:
I need to be able to add a field that uses a custom analyzer.

In a perfect world I would be able to just drop the 'customanalyzer.jar' somewhere in the solr folder and trigger zookeeper to propagate that to the various cores. As I have not seen any mention of how to do that in the ref guide or online I am assuming I really do need to use the blob store thingy which is unfortunate.

I have worked through the following steps,

                create my initial collection 'tdt2' based off of 'basic_configs'

                create .system collection to add jars
                                add 'customanalyzer.jar' to .system

                attempt (but get errors) to 'add-runtimelib' to tdt2 collection

                shutdown solr so I can restart with "-Denable.runtime.lib=true"

                start solr

                                run healthcheck on solr -c tdt2 and learn that tdt2 does not exist
                                run healthcheck on solr -c .system and learn that .system does not exist


So my initial questions are...

                how do I start solrcloud so that it 'loads' the collections that have been created?

                is there a more straightforward way to add a custom analyzer when using SolrCloud?

                what mechanism do people actually use to load plugins to solr cloud?


Thanks!
Stuart

RE: using custom analyzer on SolrCloud

Posted by "Rose, Stuart J" <St...@pnnl.gov>.
Thanks that simplifies things!

Creating a lib folder under solr home and placing the customanalyzer.jar there works for me :) 

I also had to change how I start solr and create the collection, here are the steps I followed after copying 'basic_configs' to 'tdt_configs' in the solr/configsets folder: 

	bin/solr start -cloud
	bin/solr create_collection -c tdt2 -d tdt2_configs -shards 2
	bin/solr stop -all
	bin/solr start -cloud
	bin/solr healthcheck -c tdt2
	curl 'http://localhost:8983/solr/tdt2/schema/fields?wt=json'



Stuart


-----Original Message-----
From: Shawn Heisey [mailto:apache@elyograg.org] 
Sent: Sunday, April 03, 2016 8:04 PM
To: solr-user@lucene.apache.org
Subject: Re: using custom analyzer on SolrCloud

On 4/2/2016 9:04 PM, Rose, Stuart J wrote:
> I am trying to setup on my dev workstation a small SolrCloud in order to assess the faceting capability in Solr 5.5 and I have several questions.
>
> First some context:
> I need to be able to add a field that uses a custom analyzer.
>
> In a perfect world I would be able to just drop the 'customanalyzer.jar' somewhere in the solr folder and trigger zookeeper to propagate that to the various cores. As I have not seen any mention of how to do that in the ref guide or online I am assuming I really do need to use the blob store thingy which is unfortunate.

On every server, create a "lib" directory in the Solr home.  Where this lives will depend on exactly how you installed Solr and how you're starting it.  Normally your core instanceDirs will be in the Solr home.

Copy your jar into that lib directory.  It will be loaded once when Solr starts, and will be available to every core on that machine.  No "lib"
config elements are necessary, and trying to load jars from this directory will probably break those jars, because then they would be loaded twice.

Alternately you could use the blob store, but I have no idea how to do it, or which version of Solr includes that feature.

Thanks,
Shawn



Re: using custom analyzer on SolrCloud

Posted by Shawn Heisey <ap...@elyograg.org>.
On 4/2/2016 9:04 PM, Rose, Stuart J wrote:
> I am trying to setup on my dev workstation a small SolrCloud in order to assess the faceting capability in Solr 5.5 and I have several questions.
>
> First some context:
> I need to be able to add a field that uses a custom analyzer.
>
> In a perfect world I would be able to just drop the 'customanalyzer.jar' somewhere in the solr folder and trigger zookeeper to propagate that to the various cores. As I have not seen any mention of how to do that in the ref guide or online I am assuming I really do need to use the blob store thingy which is unfortunate.

On every server, create a "lib" directory in the Solr home.  Where this
lives will depend on exactly how you installed Solr and how you're
starting it.  Normally your core instanceDirs will be in the Solr home.

Copy your jar into that lib directory.  It will be loaded once when Solr
starts, and will be available to every core on that machine.  No "lib"
config elements are necessary, and trying to load jars from this
directory will probably break those jars, because then they would be
loaded twice.

Alternately you could use the blob store, but I have no idea how to do
it, or which version of Solr includes that feature.

Thanks,
Shawn