Question

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):

{|\owstaxIdFeatures:{Page.owstaxIdFeatures}}

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:

{Page.owstaxIdFeatures}

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!

Was it helpful?

Solution

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

{|owstaxIdFeatures:{Page.Features}}

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top