2

I want to build a sharepoint online search result source that includes only some site collections and subsites. I have over 5000 Site collections, so I can't use named URLs/site ids in the result source - not maintainable. Instead I hope to add an indexed property to a site's property bag after site is provisioned then map a managed property to it, and use it in a resultsource to filter search results to match only content found in sites that have that property value. The Phil Harding's article describes the approach: https://platinumdogs.me/2015/02/06/set-a-propertybag-property-as-indexed-queryable-via-search-using-csom-powershell/ and Mike Morawski adds some code for the indexed property encoding - http://www.migee.com/2015/09/14/allowing-property-bag-values-to-be-searched-via-sharepoint-search/ I used bits of both to implement this approach.

Approach:

  1. Add Key = 'SiteType', Value = 'MySiteType' to Web All Properties
  2. Add Indexed Property 'SiteType' with 'MySiteType' Value to web IndexedProperties (vti_indexedpropertykeys). Key encoded to base64
  3. Add Managed Property 'propSiteType' mapped to 'SiteType' Crawled property in Search Schema manually.

I've done 1 and 2 via Powershell+CSOM, and verify site property added and is crawled. Managed Property is there, but It is not available in ResultSource builder dialog, and any searches such as {searchterms} propSiteType:MySiteType or (contentclass:STS_Web OR contentclass:STS_Site) propSiteType:MySiteType do not return results.

Ideas or alternative approaches? Thanks in advance

  • 1
    Not sure why someone down-voted this. I canceled out his/her vote. It is a complex subject, but the question is clear for those knowledgeable in this area and it includes references that discuss the solution that is not working for you (for some reason). – Kirk Liemohn Jan 30 '19 at 13:24
  • 1
    @KirkLiemohn - Ditto. I really, really, really hope SO starts requiring comments for down votes. – Tracy Feb 05 '19 at 17:45
  • Your site index property will be crawled (confirm by looking at the search crawled properties), however there will need to be a Managed Property (Search Schema) that is Query-able for you to query on it. With SharePoint Online, the best I could do is to map the newly crawled property propSiteType to a RefinableString..., then you'll be able to query/filter on the RefinableString.... – Tinminator Nov 10 '21 at 11:33

1 Answers1

2

My only thought is an indexing delay. I have seen O365 take days to index new content, and that's even when manually requesting a crawl. If that was the issue, it's probably resolved by now. Are you seeing relevant search results?

https://www.sharepointnutsandbolts.com/2013/10/waiting-for-search-crawl-in-office-365.html

Tracy
  • 680
  • 7
  • 16
  • 1
    I think this is the correct answer and that looks like a great link. I have been talking with worksofwisdom behind the scenes and I think things are working now. I'll nudge him to chime in. What would be nice is to have a good understanding of what the expectations are around content being indexed and any additional delay for new managed properties if they are added to the mix. – Kirk Liemohn Feb 07 '19 at 13:54
  • 2
    The issue resolved itself, but after 3. days. Good link on manually requesting a crawl, thanks for that - the main learning was to manually reindex any sites which may have properties that are mapped to a new managed property - the standard incremental crawl didn't pick up the mapping. It appears this was eventually reindexed and problem was resolved. Worth it to note that new managed properties never populate in the result source query builder - you have to know the name/alias. – worksofwisdom Feb 07 '19 at 14:19