Gravatar for dipsindol@gmail.com

Question by DEEPTHI KATTA, Oct 4, 2016 6:42 PM

Results - Tabbed or In General -limit to children/descendants of context item

Hi There, FYI, On Pro version of Coveo, so I do not have access to rule editor in my case Also, if it is helpful on Sitecore 8.1, update 2

I am trying to restrict the results on a tabbed coveo search page to only show results -

  1. Specific template/s - I implemented this based on below and got it working https://developers.coveo.com/display/public/SitecoreV4/Using+Boosting+or+Filtering+Rules+on+the+Tab+Component+Programmatically
  2. Only show results that are children/descendants of context item (The item that has coveo components on it for example)
1 Reply
Gravatar for sbelzile@coveo.com

Answer by Sébastien Belzile, Oct 5, 2016 8:22 AM

Use the field "_path". This field is a multi-value facet which contains the GUID of all the items in the path of the item. Ex:

11111111111111111111111111111111,0de95ae441ab4d019eb067441b7c2450,110d559fdea542ea9c1c8a5df7e70ef9,272033df79e14afaaba855fe4e862486

for Sitecore/content/home/myItem.

So, if you want only children of the /sitecore/content item, your query will look like this: @fz95xpathXXXXX=="0de95ae441ab4d019eb067441b7c2450". (casing doesn't matter but format does. Do not use hyphens in the ID.).

Gravatar for sbelzile@coveo.com

Comment by Sébastien Belzile, Oct 12, 2016 2:25 PM

  1. "Does this mean - I have to inject this on to filter of search": yes. I see a problem with your code though: Model.ToCoveoFieldName("_path") => Model.ToCoveoFieldName("path") (one underscore only).

  2. Could you open another question for this second question?

Ask a question