After updating drupal/search_api_solr from 4.3.10 to 4.3.12 on Drupal 10.6.14, Search API Autocomplete stopped returning suggestions for an index field of type solr_text_unstemmed.
The index contains two fields based on the same source property:
field_vrije_term_name:
property_path: 'field_vrije_term:entity:name'
type: 'solr_text_custom:string'
trefwoorden_unstemmed:
property_path: 'field_vrije_term:entity:name'
type: solr_text_unstemmed
field_vrije_term_name is populated and returns Terms/autocomplete suggestions. However, trefwoorden_unstemmed is empty after a full reindex.
The generated Solr mapping for the unstemmed field is:
m_trefwoorden_unstemmed
This appears incorrect. For the Dutch unstemmed field type, I would expect a language-specific `tu` field such as:
tum_X3b_nl_trefwoorden_unstemmed
On the affected site, Solr documents contain values in tcstringm_X3b_nl_field_vrije_term_name, while m_trefwoorden_unstemmed is null. Solr Terms returns suggestions for the former and an empty result for the latter.
Downgrading Search API Solr to 4.3.10 restores autocomplete. The regression appears to have been introduced in 4.3.11, which includes hook-related changes.
Comments
Comment #2
mkalkbrennerI was able to reproduce that with a test:
Comment #4
mkalkbrennerComment #6
ecvandenberg commentedTested the latest drupal/search_api_solr:4.x-dev@dev just now and indeed, autocomplete is returning suggestions again.
Comment #7
stefan.kornConfirm issue and fix. This does not only affect autocomplete (or autocomplete is only the symptom, not the cause), but solr_text_unstemmed in general. Field stays empty in index without the patch.
Comment #8
stefan.kornAnd since current version of search_api_solr with the fix only supports 11.3 and above, using Drupal 10.6 you would need this patch.