Monday, December 30, 2013

Indexing SharePoint list columns

We can index the columns in SharePoint to improve the performance. Indexing on the columns enables us to analyze the data quickly for a specific column. We can use filters for indexed to view large number of items to use for sorting, grouping and filtering. We can create the indexes for list and library columns.
For the additional column index, it will take more resources from the database. By adding the indexes we have to columns will be used for view items in SharePoint list.
We add indexes in SharePoint list manually or using SharePoint object model. We can create indexes for SharePoint list/library using following code
To create on Single column (Single Column index)

using(SPSite currentSite=new SPSite(“SiteURL”)
{
                    using(SPWeb currentWeb=CurrentSite.OpenWeb())
                    {
                               SPList currentList=CurrentWeb.Lists[“List Name”];
SPField titleFiled = currentList.Fields["Title"];
titleFiled.Indexed = true;
titleFiled.Update();

currentList.FieldIndexes.Add(titleFiled);
                    }
}

We can create compound index using following code

using(SPSite currentSite=new SPSite(“SiteURL”)
{
                    using(SPWeb currentWeb=CurrentSite.OpenWeb())
                    {
                               SPList currentList=CurrentWeb.Lists[“List Name”];
SPField createdByField = currentList.Fields["Author"];
createdByField.Indexed = true;
createdByField.Update();

SPField createdField = list.Fields["Created"];
createdField.Indexed = true;
createdField.Update();

list.FieldIndexes.Add(createdByField, createdField);
                    }
}

We can create the index only few fields in SharePoint list. It is not possible to create the indexing for all the fields in a list. Here are the list of the fields we can create indexing.

Thursday, December 26, 2013

Map crawled property to a managed property in SharePoint search

In SharePoint search, we can map crawled properties with managed properties. We can map the properties by using the steps below,

Navigate to Site settings page in SharePoint site collection and click on Search schema in Site collection Administration section.


In Site Collection Administration – Managed Properties page, enter the Managed property name in Managed property text box to search. Select the property, click on Edit/Map property option.



In Edit Managed Property page, “Mappings to crawled properties” section, select “Include Content from all crawled properties” option and click on “Add a Mapping” button.



In crawled property section dialog box, Search for a crawled property name field, enter the property name and click on “Find” button to search for the property.



We can the properties in “Select a crawled property” box. Select the properties and click on OK to save the settings.

Friday, December 20, 2013

“The maximum number of allowed sessions per user has been exceeded. This operation cannot be completed” Error in SharePoint Excel services

While working with SharePoint Excel chart and graphs I got an error saying that “The maximum number of allowed sessions per user has been exceeded. This operation cannot be completed” as shown the image below.


We can get this error maximum sessions limit exceeded. By increasing the Maximum Session Per user limit, we can fix this error. We can increase the Maximum Sessions Per User by using the steps below,

Navigate to Application Management page and click on Manage Service Application link in Service Applications section. 



Click on Excel Service application in the list of service applications



 In Manage Excel Services Application page, click on “Global Settings” link






In Excel Services Application Settings page, “Session Management” section, enter Maximum sessions Per User. By default it is 25.  


Thursday, December 19, 2013

Configure custom search result type in SharePoint site collection

Search result type is a rule that displays the search results in different ways. It will consist conditions that compare the search results. It also consists display template to use search results to meet the conditions.
To configure custom search result type we have to follow the steps below,
Navigate to Site Settings page, click on Search Result types in Site Collection Administration section.


Click on New Result Type to create new result type in Manage Result Types page.



We’ll navigate to Add Result Type page. In Add Result Type page Enter the name in “Give it a name” text box in General Information Section.








In Conditions section, we can specify source in “Which source should results match?” drop down. In What types of content should match? You can skip this rule to match all content” drop down allows us to specify the matched content. Here we have options to add more values by clicking on “Add Value” link.



In “Show more conditions” section, we can specify we can specify conditions for the search by specifying the values in “Which custom properties should match?” section.



In “Actions” section, “What Should these result look like” dropdown we can select display type. By checking “Optimize for frequent use” check box to appear the results frequently in search results.


Wednesday, December 18, 2013

Import query suggestions in SharePoint search

In SharePoint search query suggestion allows users to enter the search terms easily by appearing the suggestion words under the search box. SharePoint automatically create the suggestions depending on the previous search history. We can create query spelling suggestions manually by exporting the query suggestions file.

We can create query suggestions by creating the new text file and adding the query spellings one word per a line.


Save the text file as .txt with UTF-8 encoding format.



To import query suggestions file in SharePoint site Navigate to Search Administration page in SharePoint central Administration (Application Management -> Manage Service Applications -> Search Service Application) and click on “Query Suggestions” link in quick launch Queries and Results section.


In Query Suggestion Settings page, , Select “Show search suggestions” check box and Select “Language for suggestion phrases” section select Language as “English”. In Always suggest phrases section click on “Import from text file” link to upload the text file. 



In “Import phrases for query suggestions” page, Text file with phrases section click on browse button to browse and add query suggestion text file created earlier, click on ok to save the settings.