I'm using on prem Sharepoint 2013 and I have a managed metadata column called Features, which allows authors to enter multiple values. In each item that has a content type that includes this site column, I would like to have a "Related Links" SRWP that shows all site pages that have the same "Features." So lets say Page A has "Feature1; Feature2" in the "Features" managed metadata column. I would like Page A's "Related Links" SRWP to show all other site pages whose "Features" column includes either "Feature1" or "Feature2."

It seems like I found the answer in this article, under the heading Query variables with multiple values. According to what I read there, I constructed this query text for my SRWP (I tried a few variations of the following with the escape "\" character):


However, while that query returns a few results, it does not return all of them, and I cannot seem to see a pattern as to which results it returns. For instance, it will return a couple of pages that have just "Feature1" but not all. It also returns a couple of pages that have both "Feature1" and "Feature2" as well as another feature in the "Features" column, but again, not all. I also get the exact same results when the query looks like this:


Am I going about this the wrong way? It doesn't seem like something that should be so difficult, but I'm stumped ;-).

Any help would be greatly appreciated!


So, thanks to the brilliant help of MIKAEL SVENSON, the syntax that is working correctly is:


For the query to work, the metadata field on the page had to be referred to instead of the managed property field name. Additionally, in order to exclude the current page from the results (because we don't want the current page to show in the "Related Links" section), the final syntax looks like this:

{|owstaxIdFeatures:{Page.Features}} -Path:{Page.URL}

Thanks again to Mikael and all of his blogs on KQL (see comments section).

|improve this answer|||||

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.