Where to find tutorial for studying how to use ?, {, \ in search query like {searchboxquery?} in SharePoint 2013

  • Have a look at technet.microsoft.com/en-us/library/jj683123.aspx – Bunzab Jan 24 '17 at 14:08
  • Thanks for your reply Bunzab. But this still does not give me what happen when I use ? \ :( – Mung Sukte Jan 24 '17 at 14:15
  • Do you know what the ? means in a URL? – Danny '365CSI' Engelman Jan 24 '17 at 14:50
  • Yes, Danny. Thanks. One of my solution to get result only from current site is \\{SearchBoxQuery?} Path:my site path. And another query text to search only from my list title goes like this : {?Title:{searchTerms}}. So, in these two solutions the use of "?" are different. And the usage of "\\" in the first solution. These both solutions works but didnt get how actually works. – Mung Sukte Jan 24 '17 at 15:30
  • Using {? searchTerms} means if the searchquery variable is empty everything between the braces will be omitted from the query. I have not used nor do I know what the double backslashes are used for... – Bunzab Jan 24 '17 at 15:36

Follow the Article

Adding \\{searchboxquery?} to your Search Results Web Parts content source should work. If you are redirected to osssearchresults.aspx it sounds like you have changed the settings on the Search Box Web Part, make sure the setting; Send queries to other Web Parts on this page is checked, and your Search Result Web Part is marked as retriever.

  • Thanks for your reply Krumil. Infact I have solved my issue by looking at the article your have provided. But my question here is what is the significance of ? { \ in building query text. I need white paper or tutorial on this. – Mung Sukte Jan 24 '17 at 14:09

The curly brace wraps your terms, the question mark removes the query if the contents is null, the backslash is an escape character.

Follow this terrific series: SharePoint Search Queries Explained specifically this section: Query Variables and Constants Better yet buy the ebook "Search Queries Explained" it is well worth the $10.

  • Wow, Thanks alot Matthew. There are alot to study. This is what I am looking for. Your answer priceless..:) – Mung Sukte Jan 25 '17 at 18:52
  • Can I get you to mark this as the answer? :) – Matthew McDermott Jan 25 '17 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.