2
  • I have set a crawled property at the site level using
    $site.IndexPropertyKey.Add() and $site.Properties.Add()
  • I set the value of that property to "somevalue"
  • I full crawled.
  • I mapped it to a managed property.
  • Next, I went to change the query in a content search web part to just return a list of sites that match my new property. I used the query MyProperty=somevalue.
  • The previous query returns what I want, all sites that have "somevalue" in the "MyProperty" field.

The question: How do I create a query that lets me externalize the "somevalue" part?

Basically I want a query like this. MyProperty={Site.MyProperty}. I want this to display all sites that match the same value in "MyProperty" as the current site I am on. If this is confusing, I can explain more.

  • can you post script to achive this – mihir amin Jul 8 '17 at 4:08
2

I was close. The answer is ManagedPropertyName:{Site.CrawledPropertyName}. This will return all sites that match the property bag value of your current site.

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.