2

I am using sitecore 9.0.1 and sxa version 1.7. I have created a custom template with field type Drop link for the search functionality and created a rendering varient for it .But it is displaying Item ID of the field. Tried changing the field type to droplist but still the issue is same. can someone help me with this.

enter image description here

3
  • Is the selected value actually in the selection list ? And is your selected Item published ? It looks the default behavior of when switching from Treelist(or else) with valid item to Droplist with same item.. Feb 26, 2021 at 16:36
  • yes the selected value is in the selection list and i tried first with tag treelist datatype but after every change i have rebuilt my indexes also. @Jean-NicolasG
    – Vinaya
    Feb 26, 2021 at 16:56

1 Answer 1

2

You need to check this part of the documentation: https://doc.sitecore.net/sitecore_experience_accelerator/setting_up_and_configuring/configuring/extend_search#_Extend_search_to_3

This explains how to use a link type field in the facets. Add a computed field and use that fieldname in the facet:

Add the following definition to your search configuration file:

<field fieldName="referenced"
  type="Sitecore.XA.Foundation.Search.ComputedFields.ResolvedLinks, Sitecore.XA.Foundation.Search" 
  referenceField="link"
  contentField="title"/>

where:

fieldName – attribute that defines the index field name where the value will be stored.

referenceField – attribute that defines the field name of the indexed item.

contentField – attribute that defines the field of the referenced item from which the value will be retrieved during the indexing.

Don't forget to rebuild your index after the change.

And change your facet to use the newly created field in your index instead of the original one.

6
  • where can i find my search configuration file under "Appconfig/include/foundation/sitecore.XA.Foundation.Search"? @Gatogordo
    – Vinaya
    Feb 26, 2021 at 17:16
  • Please explain the above 3 fields with example i am getting confused which field names i have to provide. In my case "fieldname" refers to the template fieldname with data type droplist , "reference field" is the solr indexed name and "contentField" is the template field name where i am storing my data values ..Am i right?@Gatogordo
    – Vinaya
    Feb 26, 2021 at 17:31
  • Fieldname is the field you choose for the new index field. ReferenceField is the name of your droplink field. contentField is the fieldname in the referenced item that you want to use for display (eg. Title).
    – Gatogordo
    Feb 26, 2021 at 19:41
  • And to see the solr config, you need Sitecore.XA.Foundation.Search.Solr.config (not sure where it is located in a 1.7). But remember to patch the changes, do not change the original config file.
    – Gatogordo
    Feb 26, 2021 at 19:43
  • This is not working @Gatogordo <field fieldName="color_sm" type="Sitecore.XA.Foundation.Search.ComputedFields.ResolvedLinks, Sitecore.XA.Foundation.Search" referenceField="color"contentField="Color"/>.I added this solr search config file but still i am getting the Item ID of the fields not its values or name.
    – Vinaya
    Mar 4, 2021 at 6:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.