3

The problem I'm trying to solve is I have a content type "wiki page" that contains a custom site column called "features". I have a "issues" folder on my site filled with other "wiki pages" which also have the features column type.

I'm trying to build a content search app that displays any "wiki pages" from that folder that match the "features" of the current page that the content search web part resides on.

I can easily pull everything from the folder, I can even search for a particular feature, but does KQL allow me to pull from something currently on the page to find what I should even be looking for?

2

I Finally figured it out. I was doing two things wrong.

Anytime you're searching other pages for a site column, you're not searching for a column called "features" you need to search for a second column that was automatically created when you built your site column. (it will be listed under Schema in site settings, most likely it has a OWS appended to the name) That's what is actually being updated and crawled periodically. That's how I finally got multiple results to start appearing. FeaturesOWSTXT:{page.Features}

My second problem was that choice Columns were a terrible way of doing what I was trying to do. It works great when there is only one result for Page.Features but the moment you get two or more a choice column will return feature1;#feature2;#feature3;# (etc.) wherever page.Features is. KQL does not like that (although I don't know why they bothered making it return like that then). It kind of defeats the purpose of a multiple choice column.

I ended up switching from a Multiple Choice column to a managed meta data column and using it as a multiple choice column. Then the only thing I had to write was {?{|owstaxIdProductFeatures:{page.ProductFeatures}}} and voila.

Moral of the story... just stick with managed meta data. A multiple Choice column just... It just pales in comparison compared to what you can do with the term store.

http://www.techmikael.com/2014/03/sharepoint-search-queries-explained.html

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.