0

We are using SharePoint 2013 search and we created a result source and have the following query:

((((MyCompanyAudienceTargetBy="Business Unit") AND ALL("{\User.PreferredBU.Name} {\User.PreferredCountry.Name};#")) OR ((MyCompanyAudienceTargetBy="Region") AND ALL("CT:{\User.PreferredCity.Name};#")) OR ((MyCompanyAudienceTargetBy="Business unit and Region") AND ALL("BU:{\User.PreferredBU.Name}-CT:{\User.PreferredCity.Name};#")) OR ((MyCompanyAudienceTargetBy:"Major City") AND ALL("{\User.PreferredCity.Name};#")) OR ((MyCompanyAudienceTargetBy:"Country") AND ALL("{\User.PreferredCountry.Name};#")) OR (MyCompanyAudienceTargetBy:"Everyone"))) AND (MyCompanyPeopleLeadersOnly=false   OR (MyCompanyPeopleLeadersOnly={\User.MyCompanyPeopleLeader})   OR NOT(MyCompanyPeopleLeadersOnly=false OR MyCompanyPeopleLeadersOnly=true))  {SearchTerms}

I have used SharePoint 2013 Search Query tool: https://sp2013searchtool.codeplex.com/ and was able to see word documents in the result, thus I suspect is the query is the issue, but I don't see how the above query won't show any word documents in the search result.

1
  • When you add the filter to 'only return items' it puts this in (contentclass:STS_ListItem OR IsDocument:True). I would say you need to include that somewhere in your query.
    – Jordan
    Dec 1, 2014 at 18:04

1 Answer 1

0

The Search Query Tool (SQT) and SharePoint webparts use the same API to retrieve the results. Could you use the standard "local sharepoint results" result source and put in your query? It should then give you the same result as with SQT, right?

  • If so, your result source is broken.
  • If not, use the Live Monitoring on-premise tool (bundled with SQT) to see how your query was transformed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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