As noted earlier, business rules are enabled by default. However, that may introduce unnecessary performance lags or create errors with traditional index replication. To disable business rules, you must remove or comment out references to rules in the solrconfig.xml file for each collection.
It would be possible to remove these rules parameters from the default solrconfig.xml file and create a template for future collection creation. To learn more about this, see the section on Collection Templates.
| When removing business rules from the solrconfig.xml file, LucidWorks will need to be either stopped while making the changes, or restarted once the changes are made. |
These are the steps to disabling business rules:
Remove Rules from Update Chain
Comment out the section that defines the Rules Update Processor (<processor class="com.lucid.rules.RulesUpdateProcessorFactory"> until the closing </processor> tag).
In most cases, this is sufficient to disable business rules. However, the next sections will assist you in fully removing business rules from your implementation.
<updateRequestProcessorChain name="lucid-update-chain"> <processor class="com.lucid.update.CommitWithinUpdateProcessorFactory"/> <processor class="com.lucid.rules.RulesUpdateProcessorFactory"> <str name="requestHandler">/rulesMgr</str> <!-- we re-use the engine, but we could have an independent one--> <str name="engine">docs</str> <!-- Each one should have it's own handle, as you can have multiple in the chain --> <str name="handle">docProc</str> </processor> <processor class="com.lucid.update.DistributedUpdateProcessorFactory"> <!-- example configuration... "shards should be in the *same* order for every server in a cluster. Only "self" should change to represent what server *this* is. <str name="self">localhost:8983/solr</str> <arr name="shards"> <str>localhost:8983/solr</str> <str>localhost:7574/solr</str> </arr> --> </processor> <processor class="solr.LogUpdateProcessorFactory"> <int name="maxNumToLog">10</int> </processor> <processor class="solr.DistributedUpdateProcessorFactory"/> <processor class="com.lucid.update.FieldMappingUpdateProcessorFactory"/> <processor class="solr.RunUpdateProcessorFactory"/> </updateRequestProcessorChain>
The specific section to remove is:
<processor class="com.lucid.rules.RulesUpdateProcessorFactory"> <str name="requestHandler">/rulesMgr</str> <!-- we re-use the engine, but we could have an independent one--> <str name="engine">docs</str> <!-- Each one should have it's own handle, as you can have multiple in the chain --> <str name="handle">docProc</str> </processor>
Remove Rules from the Standard Request Handler
Find the section as below that defines the /lucid request handler, and remove the lines for landingPage and firstRulesComp and lastRulesComp.
<requestHandler class="solr.StandardRequestHandler" name="/lucid"> <arr name="components"> <str>filterbyrole</str> <str>landingPage</str> <str>firstRulesComp</str> <str>query</str> <str>mlt</str> <str>stats</str> <str>feedback</str> <!-- Note: highlight needs to be after feedback --> <str>highlight</str> <!-- Note: facet also needs to be after feedback --> <str>facet</str> <str>spellcheck</str> <str>lastRulesComp</str> <str>debug</str> </arr>
Remove the Rules Request Handler
The rules request handler defines the RuleEngine instances and the rules files. The entire section copied below can be removed or commented out.
<requestHandler class="com.lucid.rules.RulesEngineManagerHandler" name="/rulesMgr"> <!-- Engines can be shared, but they don't have to be. A SearchComponent or other consumer can specify the engine they want by name. --> <lst name="engines"> <lst name="engine"> <str name="name">first</str> <str name="class">com.lucid.rules.drools.stateless.StatelessDroolsRulesEngine</str> <lst name="rules"> <str name="file">rules/defaultFirst.drl</str> </lst> <!-- The fact collector defines what facts get injected into the rules engines working memory --> <!--<lst name="factCollector"> <str name="class">com.lucid.rules.drools.FactCollector</str> </lst>--> </lst> <lst name="engine"> <str name="name">landing</str> <str name="class">com.lucid.rules.drools.stateless.StatelessDroolsRulesEngine</str> <lst name="rules"> <str name="file">rules/defaultLanding.drl</str> </lst> </lst> <!-- Engine is using rules that are designed to be called after all other components --> <lst name="engine"> <str name="name">last</str> <str name="class">com.lucid.rules.drools.stateless.StatelessDroolsRulesEngine</str> <lst name="rules"> <str name="file">rules/defaultLast.drl</str> </lst> </lst> <lst name="engine"> <str name="name">docs</str> <str name="class">com.lucid.rules.drools.stateless.StatelessDroolsRulesEngine</str> <lst name="rules"> <str name="file">rules/defaultDocs.drl</str> </lst> </lst> </lst> </requestHandler>
Remove Rules Search Components
The search components allow the rules to make changes to queries, based on the rules defined. The entire sections shown below can be removed or commented out.
<searchComponent class="com.lucid.rules.LandingPageComponent" name="landingPage"> <str name="requestHandler">/rulesMgr</str> <str name="engine">landing</str> <!-- The handle can be used to turn on or off explicit rules components in the case when you have multiple rules at different stages of the component ordering --> <str name="handle">landing</str> </searchComponent> <searchComponent class="com.lucid.rules.RulesComponent" name="firstRulesComp"> <str name="requestHandler">/rulesMgr</str> <str name="engine">first</str> <!-- The handle can be used to turn on or off explicit rules components in the case when you have multiple rules at different stages of the component ordering--> <str name="handle">first</str> </searchComponent> <searchComponent class="com.lucid.rules.RulesComponent" name="lastRulesComp"> <str name="requestHandler">/rulesMgr</str> <str name="engine">last</str> <str name="handle">last</str> </searchComponent>
Remove the RulesDocTransformer
The RulesDocTransformer allows business rules to inject or modify fields in a document before returning them to a client.
<transformer class="com.lucid.rules.RulesDocTransformerFactory" name="rules"> <str name="requestHandler">/rulesMgr</str> <str name="engine">first</str> </transformer>
Remove Rules From the Replication Handler
If using Index Replication, remove the rules-related files from the list of conf files to replicate between servers. In this section:
<requestHandler class="solr.ReplicationHandler" name="/replication"> <lst name="master"> <str name="replicateAfter">commit</str> <str name="confFiles">admin-extra.html,admin-extra.menu-bottom.html,admin-extra.menu-top.html,elevate.xml,LucidStemRules_en.txt, protwords.txt,schema.xml,solrconfig.xml,stopwords.txt,stopwords_ar.txt,stopwords_cjk.txt,stopwords_cs.txt,stopwords_da.txt,stopwords_de.txt, stopwords_el.txt,stopwords_es.txt,stopwords_fa.txt,stopwords_fi.txt,stopwords_fr.txt,stopwords_hu.txt,stopwords_it.txt,stopwords_ja.txt, stopwords_ko.txt,stopwords_nl.txt,stopwords_pl.txt,stopwords_pt.txt,stopwords_ru.txt,stopwords_se.txt,stopwords_tr.txt,stopwords_ur.txt, stopwords_zh.txt,synonyms.txt,contractions_fr.txt,contractions_it.txt,stoptags_ja.txt,mapping-japanese.txt,stemdict_nl.txt, rules/defaultFirst.drl,rules/defaultLast.drl,rules/defaultLanding.drl,rules/defaultDocs.drl</str> </lst> </requestHandler>
Specifically, remove rules/defaultFirst.drl, rules/defaultLast.drl, rules/defaultLanding.drl, and rules/defaultDocs.drl.