Opensolr Index fails to reload when AnalyzingInfixSuggester is used as a Suggester

Errors
SOLR CONFIGURATION ERROR

AnalyzingInfixSuggester Reload Failure

When multiple Solr suggesters share the same data directory, index reloads fail with a LockObtainFailedException. Here's how to fix it.

What Is AnalyzingInfixSuggester?

AnalyzingInfixSuggester is a Solr component that powers autocomplete and type-ahead search. Unlike basic prefix matchers, it can find matches within words — so typing "york" will match "New York".

To do this, it builds its own internal Lucene index inside a data directory (by default called analyzingInfixSuggesterIndexDir). This is where the problem starts.

Why Does Reload Fail?

When your Solr configuration defines multiple suggester dictionaries (e.g., one per language), and they don't each have their own indexPath, they all try to write to the same default directory. When a commit or reload triggers a rebuild, multiple suggesters race for the same write lock — and all but one fail.

org.apache.lucene.store.LockObtainFailedException: Lock held by this virtual machine:
  /usr/share/solr/example/multicore/YOUR_INDEX/data/analyzingInfixSuggesterIndexDir/write.lock

This is especially common when Drupal's search_api_solr module exports the Solr configuration — it often omits the indexPath parameter, causing all suggesters to collide. See the Drupal bug report for details.

How the Collision Happens

Suggester ENbuildOnCommitSuggester ESbuildOnCommitSuggester ARbuildOnCommitSame Directory!analyzingInfixSuggesterIndexDir/write.lockCOLLISION!

How to Fix It

Option 1: Add indexPath (Recommended)

Give each suggester its own directory. This is the simplest and most reliable fix.

Option 2: Switch Lookup Factory

Use BlendedInfixLookupFactory instead — it handles reloads more gracefully.

Option 3: Remove the Suggester

If you don't need autocomplete, remove the suggester entirely.

Option 1: Add a Separate indexPath for Each Suggester

Open your solrconfig_extra.xml (or solrconfig.xml) in the Opensolr Config Files Editor. Find each <lst name="suggester"> block and add a unique indexPath:

<!-- Each suggester MUST have its own indexPath -->
<lst name="suggester">
  <str name="name">en</str>
  <str name="indexPath">./en</str>
  <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
  <str name="dictionaryImpl">DocumentDictionaryFactory</str>
  <str name="field">suggest_field</str>
  <str name="suggestAnalyzerFieldType">text_en</str>
</lst>

<lst name="suggester">
  <str name="name">es</str>
  <str name="indexPath">./es</str>
  <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
  ...
</lst>

The indexPath value is relative to the core's data directory. Using ./en creates a folder called en/ inside data/. Each suggester now has its own Lucene index and its own write lock — no collision.

After the Fix

Suggester ENindexPath: ./enSuggester ESindexPath: ./esSuggester ARindexPath: ./ardata/en/data/es/data/ar/No Collision

Option 2: Switch to BlendedInfixLookupFactory

BlendedInfixLookupFactory is an alternative that also supports infix matching but handles reloads more gracefully. Simply replace AnalyzingInfixLookupFactory with BlendedInfixLookupFactory:

<lst name="suggester">
  <str name="name">mySuggester</str>
  <str name="lookupImpl">BlendedInfixLookupFactory</str>
  <str name="dictionaryImpl">DocumentDictionaryFactory</str>
  <str name="field">suggest_field</str>
  <str name="suggestAnalyzerFieldType">text_general</str>
  <str name="blenderType">position_linear</str>
</lst>

Option 3: Remove the Suggester

If you don't need autocomplete, remove the <searchComponent name="suggest"> block and the <requestHandler name="/suggest"> from your solrconfig.xml entirely.

After Making Changes

Step 1 Upload config files
Step 2 Click Reload
Step 3 Check Error Log

Upload your updated configuration files in the Opensolr Config Files Editor, then click Reload in your Opensolr Index control panel. If the reload succeeds without errors, the fix is working. Check the Error Audit to confirm there are no remaining issues.

Still having trouble?

Our team can review your solrconfig.xml and fix the suggester configuration for you.

Contact Support