Droplist fields are resolved as text type fields instead of string type


Description

During the search by Droplist field, Droplist fields are resolved in the [fieldName]_t format instead of [fieldName]_s.

Solution

To resolve the issue, set the returnType for each affected Droplist field explicitly by creating a configuration patch file in the \App_Config\Include\zzz folder:

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">
  <sitecore role:require="Standalone or ContentManagement or ContentDelivery or XMCloud" search:require="solr">
    <contentSearch>
      <indexConfigurations>
        <defaultSolrIndexConfiguration>
          <fieldMap>
            <fieldNames hint="raw:AddFieldByFieldName">
              <field fieldName="<your_Droplist_field_name>" returnType="string" />
            </fieldNames>
          </fieldMap>
        </defaultSolrIndexConfiguration>
      </indexConfigurations>
    </contentSearch>
   </sitecore>
</configuration>