I would like to search checklist data through the Content search API in the Sitecore SXA. However, it is not searching any data based on checked value in checklist field.

Sharing code :

Name         Type
Topic        CheckList

Field in the Content Editor :

enter image description here

Property :

 public string Topic { get; set; }

Code I am using for searching:

predicate = predicate.And(x => x.Topic.Contains(filters.Topic)); 

We are passing data through filters. Such as filter value is "Topic 1" here.

Index configuration :

        <defaultSolrIndexConfiguration type="Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration, Sitecore.ContentSearch.SolrProvider" search:require="solr">
          <documentOptions type="Sitecore.ContentSearch.SolrProvider.SolrDocumentBuilderOptions, Sitecore.ContentSearch.SolrProvider">
            <fields hint="raw:AddComputedIndexField">
               <field fieldName="topic"     type="Sitecore.XA.Foundation.Search.ComputedFields.ResolvedLinks, Sitecore.XA.Foundation.Search"  returnType="stringCollection" referenceField="topic"        contentField="title" />
               <field fieldName="topic"      returnType="guid"   storageType="YES" indexType="UNTOKENIZED" vectorType="NO" boost="1f" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider" />
  • Have you tried passing ID of the topic 1? Jul 16 '20 at 9:38
  • yes, i have tried this but it was not working.
    – Ashish
    Jul 16 '20 at 9:49
  • @Marek , I am checking Sitecore SXA is not creating any index for this field. Is it the issue ?
    – Ashish
    Jul 16 '20 at 10:43
  • Use solr admin to check if the field is populated and what are the values in it. Then check search.log to see what is the query which is sent to solr. Jul 16 '20 at 10:54
  • Now , it is creating index but still i am not able to fetch result even i tried with both(text , ID)
    – Ashish
    Jul 16 '20 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.