Office 365/SharePoint 2013 – Search Result Query Builder with {Site.Url}

Your problem

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.

Advertisements


Categories:Office 365, SharePoint, SharePoint 2013, SharePoint Online

Tags: , , , , ,

Please leave a comment or feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

%d bloggers like this: