I am trying to find a way where I can scope my search based on some application level metadata. For instance I have following simple query transforms
{searchTerms} path: *folder1*
and
{searchTerms} path: *folder2*
The idea is that I want to return results only that were found within folder1 (or folder2) under the root folder. This works with hard-coded values of folder1 and folder2. However, I want to make it dynamic. My client application uses REST APIs. Application can determine the relative path to search within a designated source and I want to somehow pass that value to query transform. I tried something like
{searchTerms} path: *{folder}*
with a REST url like
"http://mytestserver/_api/search/query?querytext='" + searchFor + "'&folder='CS1'";
I am new to SP so must be missing something very obvious. Any help will be greatly appreciated. I am working with Sharepoint 2013 foundation.