Have you ever thought about what is the most used ‘feature’ in the internet? I would loudly say: SEARCH. Just think about how many times you open the browser just to search for something rather than navigating to a specific website.
Well, we truly believe that search is also one of the key features of an Intranet. You have documents, news, articles, metadata and many other information. We know that a well-done navigation will help, but with a really good search engine, your content will be taken to another level.
In the article below we are going to talk about a small piece of this important feature of SharePoint, the Search and how to configure it. Because the search index determines what the users will see when they perform their search it very important to know how it works and what it is comprised of.
This article dives deep into the Search Schema, how and which data is crawled and eventually how to make relevant data available to the end user, for searching and displaying.
SharePoint Search: Managed Properties
When a user tries to search something using the SharePoint Search, the operation will only result in items that are indexed (discovered data during the crawling of the sites).
Not everything that is stored inside SharePoint is crawled by the Search. Moreover, the Search Schema contains a list of crawled properties that tells the Search what is useful and should be crawled and stored in the index.
Here you can find the list of all out-of-the-box fields that are crawled by the SharePoint Search: https://docs.microsoft.com/en-us/sharepoint/technical-reference/crawled-and-managed-properties-overview
Even though SharePoint Fields (from Lists or Document Libraries) are being crawled, there are some field types that are not searchable. Hence, despite the Search running and the all the properties being crawled, there is a possibility that when a user searches by a criteria, the field containing the relevant information not to be searchable (does not exist in the index) and thus, not all the results to be displayed. An example of field types that are not searchable are:
What are Search Managed Properties?
In the context of SharePoint Search Managed properties are the properties defined on one or more crawled properties. The reason for having as data source multiple crawled properties is the case when having multiple repositories/sources of information that respective information may come under different names.
The managed properties are a list of useful content and metadata which the search schema contains. The search index includes only content and metadata from the managed properties.
A managed property has a name, a description and a type. The types of information that can be stored in the managed property are:
- Date and Time
- Double precision float
In the context of this article, the most important characteristics of a managed property are:
- “Enables querying against the content of the managed property. The content of this managed property is included in the full-text index. For example, if the property is "author", a simple query for "Smith" returns items containing the word "Smith" and items whose author property contains "Smith".”
- “Enables querying against the specific managed property. The managed property field name must be included in the query, either specified in the query itself or included in the query programmatically. If the managed property is "author", the query must contain "author:Smith".”
- “Enables the content of this managed property to be returned in search results. Enable this setting for managed properties that are relevant to present in search results.”
Allow multiple values
- “Allow multiple values of the same type in this managed property. For example, if this is the "author" managed property, and a document has multiple authors, each author name will be stored as a separate value in this managed property.”
- “Enable to return results independent of letter casing and diacritics(for example accented characters) used in the query.”
- “Yes - active: Enables sorting the result set based on the property before the result set is returned. Use for example for large result sets that cannot be sorted and retrieved at the same time.”
- “Yes - latent: Enables switching sortable to active later, without having to do a full re-crawl when you switch.”
- “Both options require a full crawl to take effect.”
When and how to use Managed Properties?
Mapping crawled properties to managed properties is a solution to adding content and metadata to the search index, content and metadata that might not be in the index or might not be there in the useful/friendly form.
Adding a new Managed Property requires the user to have access to the Central Farm Administration. From there go to Application Management > Manage Service Applications > Search Service Application. On the left side navigation, you can see the Search Schema under “Queries and Results”. On this page you can see the Managed Properties that are already created, and the Crawled Properties.
Important! If you do not see the property you are looking for in the Crawled Properties make sure that the Site Collection (where that property was created) has been crawled and that you have at least one list item with that property filled in.
Click on the “New Managed Property” button.
Enter the name, description and choose carefully the Type of the managed property. Choose the property characteristics that accommodate your needs (normally you should always have as checked the Searchable, Queryable, Retrievable and Token Normalization).
Under “Mappings to crawled properties” click “Add a Mapping”.
And search for the Crawled Property from that list.
Important! If you do not see the property you are looking for in the Crawled Properties make sure that the Site Collection (where that property was created) has been crawled and that you have at least one list item with that property filled in. If you modify the list items or add new items to the list data source from the Site Collection, then perform a Full Crawl on the site.
Once you are done then click Ok. After that you should see your new Managed Property in the list of all Managed Properties from the Farm along with some of the options.
Important! A Full Crawl is required such that the search should index the managed property and for it to become available as search criteria for everyone.
The new Managed Property will be visible in the search results under the exact name as given when it was created.
A great tool for testing out the SharePoint Search Api is the SharePoint Search Query Tool.