Hi,

I am attempting to achieve what I believe many others have attempted in the 
past: allow an end user to modify a Solr config file through a custom UI and 
then roll out any changes made without restarting any services. Specifically, I 
want to be able to let the user edit the synonyms.txt file and after committing 
the changes, force Solr to re-index based on those changes without restarting 
Tomcat.

I have configured a Solr Master and Slave, each of which has a single core:


*         http://master:8080/solr/core

*         http://slave:8080/solr/core

The cores are defined in respective solr.xml files as:

<solr persistent="true" sharedLib="lib">
 <cores adminPath="/admin/cores">
  <core name="core" instanceDir="core">
    <property name="configDir" value="../../conf/" />
  </core>
 </cores>
</solr>

Replication has been configured in the Master solrconfig.xml as follows:

<requestHandler name="/replication" class="solr.ReplicationHandler" >
    <lst name="master">
        <str name="replicateAfter">startup</str>
        <str name="replicateAfter">commit</str>
        <str name="snapshot">startup</str>
        <str name="snapshot">commit</str>
        <str 
name="confFiles">schema.xml,${configDir}stopwords.txt,${configDir}elevate.xml,${configDir}synonyms.txt</str>
    </lst>
</requestHandler>

and the Slave solrconfig.xml as:

<requestHandler name="/replication" class="solr.ReplicationHandler" >
    <lst name="slave">
      <str name="masterUrl">http://master:8080/solr/core/replication</str>
      <str name="compression">internal</str>
      <str name="httpConnTimeout">5000</str>
      <str name="httpReadTimeout">10000</str>
      <str name="httpBasicAuthUser">username</str>
      <str name="httpBasicAuthPassword">password</str>
      <str name="pollInterval">00:00:20</str>
     </lst>
</requestHandler>

At service startup, replication works fine. However, when a change is made to 
the synonyms.txt file and 
http://master:8080/solr/admin/cores?action=RELOAD&core=core is called neither 
the Master nor Slave are updated to reflect the modification. I am assuming 
that this is because in the Master schema.xml file the SynonymFilterFactory is 
being used at index time and the CoreAdmin RELOAD does not force a Solr 
re-index. If this is so, please can someone advise what the best methodology is 
to achieve what I am attempting? If not, please could someone let me know what 
I'm doing wrong?!

Thanks,

Marc

Reply via email to