Gravatar for ncipollina@captechconsulting.com

Question by ncipollina, Jan 19, 2016 11:14 AM

Generate Clickable URI

I have a question about clickable uri's to faceted search views in Coveo. I know that the uri format for a search view with facet is something along the lines of www.baseuri.com/search?f:facet-name=[facet-value]. My question is this, is there a way to programmatically generate this url? Something analogous to using the LinkManager in Sitecore to generate your uri's. I ask because those facet field names could change, and I really don't want to include a hard-coded string value in there.

Thanks in advance, Nick

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Jan 19, 2016 12:10 PM

There's no way to generate those URIs.

The format of the URI is www.baseuri.com/search?f:FacetFieldName=[facet-value] by default.

If you edit a facet properties in the Sitecore Experience Editor or in the presentation details of your search page, there is a "Unique Id" field. If you enter a value in that field and save, the URIs when this facet will be selected will be changed to this format: www.baseuri.com/search?f:FacetUniqueId=[facet-value]

With this unique ID, you will be able to generate links to the search page that will always reference the right facets even if their field change.

I hope this helps,

Jeff

Gravatar for ncipollina@captechconsulting.com

Comment by ncipollina, Jan 19, 2016 12:25 PM

This seems like something that users might want. Anyway of getting this added to a future feature list?

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jan 19, 2016 12:35 PM

What I described is already in the product.

Gravatar for ncipollina@captechconsulting.com

Comment by ncipollina, Jan 19, 2016 1:04 PM

I meant a link manager that will build out these url's.

Ask a question