3

Is it possible to retrieve a list of values for a given crawled property? If so, how would this be achieved using PowerShell?

For example, I have a crawled property called 'Forename' and I would like to obtain a list of all values held against this property - 'Alice', 'Brian', 'Craig'... etc. I'll then use this extracted data to provide auto-complete functionality in my search centre.

1
  • Any help or pointers would be greatly appreciated. – Stuart C May 20 '15 at 14:08
0

I think you are confusing Crawled Properties with Managed Properties. Please have a look at the following StackExchange question: Crawled properties vs Managed Properties and this article by Benjamin Niaulin

A crawled property by itself is useless for you when trying to run or build search queries or even display the value of this property in search results.

The Managed Properties is where it all happens. [...] Though they have many features and configurations to them, at the core, they are the grouping of one or multiple “Crawled Properties”. Let me explain, pretend that your organization has many lists and libraries. Ok, maybe you don’t have to pretend. And in them, users created columns like “Customer Name” and “Client”. For the organization, these two columns represent exactly the same content, but not for search. For search, they are just crawled properties and two very different ones at that because they do not share the same name. On top of that, since they are only Crawled Properties, if someone searches for all documents where Client=Sharegate then they will find nothing at all. Because no search related feature works with crawled properties themselves, for that we will need to create a Managed Property called “Customer” and assign both of those crawled properties to it.

I believe the recommended answer to this question will help you, although you will be limited to top 100 values that are found for any given managed property.

In general, you can use REST API to ask search engine about possible refiners for any given managed property. Info below taken from Guy Fraser's blog post

Use following REST API call

https://mysite/_api/search/query?QueryText='*'&ContentClass='urn:content-class:SPSPeople'&selectproperties='Department'&Refiners='Department'&RowLimit=0

To break down the above URL

  • QueryText='*' – Get EVERYTHING
  • ContentClass='urn:content-class:SPSPeople' – Only People
  • selectproperties='Department' – Retrieve Department property
  • Refiners='Department' – This is the important element; retrieve all Department refiners
  • RowLimit=0 – We don't actually want any results, we just want to know what all the refiners would have been so we can fill our drop-down menu

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.