Your problem

Table of Contents

For a long time I’ve been trying to restrict a query within my SharePoint Search Result web parts to items in a list within my current site.

Including Path:{Site.Url}/MyList doesn’t seem to do the job. When I’ ve got sub sites which also include lists called MyList then I’m simply getting results from all sub sites as well.

My Solution

Then I stumbled across the following article:

https://technet.microsoft.com/en-us/library/jj683123.aspx

It mentioned the option of escaping the variables. So I included the following in my query:

Path:{\Site.Url}/MyList

And now I’m getting the right results returned.

By Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: