solrconfig_extra.xml Causes Solr write.lock issues in suggesters

Created on 24 October 2023, about 1 year ago
Updated 9 November 2023, about 1 year ago

It looks like Drupal, is exporting the Solr Configuration zip archive erroneously.

In solrconfig_extra.xml you have the definition of the suggesters. In this case: en, fr, and und.
Drupal fails to set a folder for each of those suggester dictionary, thus telling Solr, to build all those 3 dictionaries, in the same folder (the default one analyzingInfixLookupFactory), causing a write.lock conflict in Solr, which in turn causes all types of errors in the Solr index, where users are not able to use the /suggest requestHandler and other requestHandlers, at random times, obviously, when Solr is trying to build those dictionaries

To the point, here is the snippet generated by Drupal in solrconfig_extra.xml

<searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
      <str name="name">en</str>
      <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="field">twm_suggest</str>
      <str name="suggestAnalyzerFieldType">text_en</str>
      <str name="contextField">sm_context_tags</str>
      <str name="buildOnCommit">true</str>
      <str name="buildOnStartup">false</str>
    </lst>
  
    <lst name="suggester">
      <str name="name">fr</str>
      <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="field">twm_suggest</str>
      <str name="suggestAnalyzerFieldType">text_fr</str>
      <str name="contextField">sm_context_tags</str>
      <str name="buildOnCommit">true</str>
      <str name="buildOnStartup">false</str>
    </lst>
  
    <lst name="suggester">
      <str name="name">und</str>
      <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="field">twm_suggest</str>
      <str name="suggestAnalyzerFieldType">text_und</str>
      <str name="contextField">sm_context_tags</str>
      <str name="buildOnCommit">true</str>
      <str name="buildOnStartup">false</str>
    </lst>
  </searchComponent>

And this is what we added, in order to tell Solr to create the dictionaries in 3 separate folders, for each of these suggesters.
Please observe the parameter below, added to each suggester.

<str name="indexPath">./fr</str>
<searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
      <str name="name">en</str>
      <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="field">twm_suggest</str>
      <str name="suggestAnalyzerFieldType">text_en</str>
      <str name="contextField">sm_context_tags</str>
      <str name="buildOnCommit">true</str>
      <str name="buildOnStartup">false</str>
      <str name="indexPath">./en</str>
    </lst>
  
    <lst name="suggester">
      <str name="name">fr</str>
      <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="field">twm_suggest</str>
      <str name="suggestAnalyzerFieldType">text_fr</str>
      <str name="contextField">sm_context_tags</str>
      <str name="buildOnCommit">true</str>
      <str name="buildOnStartup">false</str>
      <str name="indexPath">./fr</str>
    </lst>
  
    <lst name="suggester">
      <str name="name">und</str>
      <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="field">twm_suggest</str>
      <str name="suggestAnalyzerFieldType">text_und</str>
      <str name="contextField">sm_context_tags</str>
      <str name="buildOnCommit">true</str>
      <str name="buildOnStartup">false</str>
      <str name="indexPath">./und</str>
    </lst>
  </searchComponent>

It is imperative that this gets fixed at the Drupal Module level, where users download the generated configuration zip archive, so that they won't overwrite any fixes they made on the Opensolr, or their local Solr side, on updating the configset in the future.

This should also be added wherever else multiple dictionaries are being built.

I hope this helps, and that it makes sense.

Thanks guys!
Ciprian
Opensolr.com

🐛 Bug report
Status

Fixed

Version

4.0

Component

Solr Configuration Generator

Created by

🇩🇪Germany opensolr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024