The Problem
Drupal 6.x ships Solr config files with a known bug: numeric and floating-point values are wrapped in <str> tags instead of <int> and <float> tags. Solr expects the correct XML types and will throw errors or behave unpredictably when it gets strings where it expects numbers.
What Is Wrong
In solrconfig_extra.xml (and possibly other Drupal config files), you will find entries like this:
<!-- WRONG: integers and floats wrapped as strings --> <str name="accuracy">0.5</str> <str name="maxEdits">2</str> <str name="minPrefix">1</str> <str name="maxInspections">5</str> <str name="minQueryLength">4</str> <str name="maxQueryFrequency">0.01</str> <str name="thresholdTokenFrequency">.01</str>
These should use the correct XML types based on their values:
<!-- CORRECT: proper types for each value --> <float name="accuracy">0.5</float> <int name="maxEdits">2</int> <int name="minPrefix">1</int> <int name="maxInspections">5</int> <int name="minQueryLength">4</int> <float name="maxQueryFrequency">0.01</float> <float name="thresholdTokenFrequency">.01</float>
How to Fix It
- Open your Opensolr Index Control Panel
- Go to the Config Files Editor
- Select
solrconfig_extra.xml - Find all
<str>tags that contain numeric values - Change
<str>to<int>for whole numbers and<float>for decimal numbers - Save and Reload your Opensolr Index
Also check other Drupal config files (solrconfig.xml, schema_extra_types.xml) for the same issue — this bug may appear in multiple places across different Drupal Solr versions.
Quick Reference
| Value Type | Correct Tag | Example |
|---|---|---|
| Whole number (2, 5, 100) | <int> |
<int name="maxEdits">2</int> |
| Decimal number (0.5, 0.01) | <float> |
<float name="accuracy">0.5</float> |
| Text string ("hello") | <str> |
<str name="field">suggest_field</str> |
Need help fixing Drupal config files? Reach out to us at support@opensolr.com — we can correct these issues for you instantly.