Hi,
I can use this query text on a content search web part, and get get results but when doing this programmatically, I get no results. How do I write the query if I want to get office from the logged in user?
Content search query:
contentclass:sts_listitem ContentType:"News Location" owstaxIdTargetLocation:{User.Office}
Programmatically:
keywordquery.QueryText = "contentclass:sts_listitem ContentType:\"News Location\" owstaxIdTargetLocation:{User.Office}";
I can use this query text on a content search web part, and get get results but when doing this programmatically, I get no results. How do I write the query if I want to get office from the logged in user?
Content search query:
contentclass:sts_listitem ContentType:"News Location" owstaxIdTargetLocation:{User.Office}
Programmatically:
keywordquery.QueryText = "contentclass:sts_listitem ContentType:\"News Location\" owstaxIdTargetLocation:{User.Office}";