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.
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"/>
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.