Tuesday, December 16, 2014

SharePoint 2010 Search Query Suggestions

SharePoint Query suggestions (or Search suggestions), appear below the Search Box Web Part and on the search results page.



So how do we get these query suggestions? There are 2 ways to do this :

1) The first one is created automatically based on user searches.

Query suggestions depend on users' searches. Only search queries that have been previously returned and then clicked through at least six times will appear in either the search box list. Therefore, a newly deployed SharePoint Server 2010 system will not show query suggestions in either location. Moreover, a query suggestion will only appear in the search box list if the query suggestion contains at least one of the words that are typed.

2) The second once is created manually.

We can use Windows PowerShell to manually add query suggestions. The benefit of this method is query suggestions are available immediately to users of a newly installed search system. We can also supplement the default Microsoft SharePoint Server 2010 behavior by adding query suggestions for key search terms.
In this manner, you can provide query suggestions that might not be generated by the system because users are not using the search terms that would create the query suggestions that you want to appear.

PowerShell to do this:

Here we are adding the following query suggestions manually (ford, test1, test2)

$searchapp = Get-SPEnterpriseSearchServiceApplication -Identity "<SearchServiceApplicationName>"

New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name "ford"

New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name "test1"

New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name "test2"

Start-SPTimerJob -Identity "prepare query suggestions"


There are options to turn off query suggestions so that they will not appear at query time. This is made possible by editing the Search Box Web Part.



Wednesday, December 3, 2014

How to move SharePoint list items from one list to another

If we have a list which is growing more than what was planned, it is always a good idea to split the list for performance improvement and for ease of use. There are multiple ways of doing this. Below is a simple way to do this.
For this exercise I have created 2 lists list1 and list2.My goal is to move all items from list2 to list1

1) Browse to Site Actions -> Manage Content and Structure


2) Alternatively, you can browse to Site Actions -> Site Settings -> Site Administration -> Content and structure

 
3) You are taken to the Site Content and Structure page.


4) Choose the items you want to move from list2 -> Actions -> Move


5) A pop up appears listing the destination. Choose list1


6) The move operation starts



7) list1 is populated with all items from list2.