We have overriden the default mapping by adding:

 <defaultSolrIndexConfiguration type="Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration, Sitecore.ContentSearch.SolrProvider">
    <fieldMap type="Sitecore.ContentSearch.SolrProvider.SolrFieldMap, Sitecore.ContentSearch.SolrProvider">
        <fieldNames hint="raw:AddFieldByFieldName">
              <field fieldName="vehiclename" returnType="string" indexType="string">
                <analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" />

However, while querying on this field, it is case sensitive. Kindly help

  • Are you lowercasing your queries against this field?
    – Mark Cassidy
    Commented Jul 15, 2020 at 14:03
  • Yes. searchKeyword = searchKeyword.ToLower(); predicates = predicates.And(item => item.VehicleName.Contains(searchKeyword) Commented Jul 15, 2020 at 14:13
  • Does it help if you add settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider" to the <field> element? (rebuild the index after the change)
    – Gatogordo
    Commented Jul 15, 2020 at 15:31
  • What is indexType="string"? Try to change your field parameters to <field type="System.String" fieldName="vehiclename" returnType="string" storageType="YES" indexType="TOKENIZED">, rebuild index and check in solr browser if your field values are stored in lower case.
    – x3mxray
    Commented Jul 15, 2020 at 16:54
  • @Gatogordo and x3mxray I checked with both the changes but the field is not lowercased My config: <field type="System.String" fieldName="vehiclename" returnType="string" storageType="YES" indexType="TOKENIZED" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider"> <analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" /> </field> Commented Jul 16, 2020 at 6:02


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.