michal.hubczyk
michal.hubczyk

Reputation: 697

Solr cloud - reloading elevate.xml

I am using Apache Solr 6.5 with Query Elevation Component (/elevate endpoint) to support elevation of particular documents in my queries.

I am using elevate.xml file in

<instanceDir>/conf/<config-file> 

directory. However on production server (Solr configured as cloud with zookepper to maintain configuration) changes in the elevate.xml are not loaded. To check if it works, I just query the elevated phrase and as a result I get elevated documents from previous version of elevate.xml.

Of course I am restarting all Solr cloud instances after loading new version of elevate.xml and updated file is visible in the Solr's Admin UI files section (of the particular core of course).

The query I am using to test results, to prove that I am not using stardard /query component:

/elevate?df=name&fl=id,name,[elevated]&indent=on&q=heart&wt=json

What should I do to actually tell Solr that the new elevate.xml was loaded? That works fine on my development standalone configuration of Solr (not cloud one) after the solr service is restarted, the documents are elevated by updated elevate.xml file.

Upvotes: 0

Views: 1098

Answers (2)

michal.hubczyk
michal.hubczyk

Reputation: 697

Ok I think I figured it out. The problem was with a directory in which elevate.xml file was anticipated by Solr.

The documentation states (as for 6.5.0 version)

config-file


Path to the file that defines query elevation. 
This file must exist in     <instanceDir>/conf/<config-file> or <dataDir>/<config-file>.

In my dev configuration that was true for both cases (the file was read either from conf or data directory). However on production (in cloud environment with external zooKeepers) the file was read from the root directory of a core (aka collection), where also solrconfig.xml and schema.xml exists.

Probably it has some explanation and it's just data dir itself, but since I don't know how to check what are values of instanceDir and dataDir variables, the documentation was misleading for me.

I hope it helps other Solr adepts.

Upvotes: 1

Persimmonium
Persimmonium

Reputation: 15791

You should be doing this:

  1. upload the elevate.xml file to zookeeper as explained here
  2. reload the collection with the RELOAD collection api, no need to restart Solr

Upvotes: 1

Related Questions