Gravatar for

Question by Thom Howard, Jan 23, 2019 7:51 PM

Restricting results by URI path

I'm trying to restrict results returned based on the URI path. But, the "/" value doesn't seem to be respected. For example, if my query is:


I get results that include and, etc.Which clearly don't include "" (with the trailing slash).

Without expressly excluding those URLS, how to I ensure that the URI query honors the slashes in the path?



Gravatar for

Comment by François Lachance-Guillemette, Jan 23, 2019 8:00 PM

Do you have other fields on which you could base this query? For instance, a "site" field?

Could you extract this part into a computed field for easy filtering?

I feel like this problem would be easier to solve by using an indexing solution instead of a query one.

1 Reply
Gravatar for

Answer by Jean-François L'Heureux, Jan 23, 2019 8:25 PM

Special characters are stored by Coveo but they are not indexed nor queried. They are replaced by spaces for indexing and querying.

Your query becomes: `@uri="pediasure com "`

The results returned were indexed as `"pediasure com vn "` and `"pediasure com th "` which are including `"pediasure com "`.

With Coveo for Sitecore, it is instead recommended to use the `_path` Sitecore field which contains the Short ID of all the parents of an item from the /sitecore" root. Usage is as follow: `@z95xpath=="Short ID of item you want child results"`

Ask a question