Gravatar for

Question by deepak_raghav, Jul 9, 2015 12:19 PM

Custom Field in Search Result

I'm Using Coveo's Free edition Search and i want the Alias name to be part of the search result as well. I have a field alias target but that is not the one i'm looking for. Is it possible to get the alias name tagged with the search result item in the result itself as reverse mapping is consuming a lot of time. Any help in this.

1 Reply
Gravatar for

Answer by Jean-François L'Heureux, Jul 9, 2015 1:52 PM

We need a few more information about your setup to help you with this question I think.

Is "alias target" a Sitecore field on your Sitecore items and it is indexed in your CES documents? What is its field value format in your CES documents? Is "alias name" also a Sitecore field on your Sitecore items?

Without more details, I would guess that your "alias target" Sitecore field stores the ID of the alias you set on an item. And I guess you would rather want the name of the related alias item in another field on your CES documents. This use case is covered by the ReferencedFieldComputedField Coveo computed field (see Creating a Computed Field for a Referenced Item). It will work if your alias items have their name in a field. If their name is stored in the "Name" property of the items, you will have to create your own computed field to resolve the alias item names (see TagsNamesComputedField for an example with tag items).

Gravatar for

Comment by deepak_raghav, Jul 9, 2015 2:35 PM

Alias target is a computed field created and it holds the value of the alias linked item. So the ID value is set in this field for items under system->aliases. But I want to get the alias name from the item directly.currently this field will come as 0 for the general search results returned. So from the alias item I can get the linked item but I want the alias name directly from the item.

Gravatar for

Comment by Simon, Jul 10, 2015 9:31 AM

So then the computed field code sample from JF should do the trick. See the read-me here on how to enable it.

Gravatar for

Comment by deepak_raghav, Jul 10, 2015 4:09 PM

When I create a field I have an 'id' value getting appended to it and the field reads like fsearchtag67827, ftemplate67827. Is there any way to strip out the Id getting appended to the Field. i'm currently using the Queue connector as i'm using free version of Coveo

Gravatar for

Comment by Jean-François L'Heureux, Jul 10, 2015 4:47 PM

deepak_raghav, this is a separate question not related to the current thread question. Do not post unrelated questions in the same thread. Please create separate threads for this.

For your information:

Ask a question