Create and import query suggestions in SharePoint 2013


An easy way to help users search for information in SharePoint is to create query suggestions. Query suggestions are words that appear under the search box as users type a query.

Example of query suggestion

SharePoint automatically creates a query suggestion when users have clicked a search result for a query at least six times. For example, if users have entered the query word “coffee” and then clicked on a search result six times, then “coffee” automatically becomes a query suggestion.

You can also create query spelling suggestions manually. In this blog post I’ll use a simple example to show how you can do that. In this blog post I’ll explain:

How to create a query suggestions file

  1. Open a text editor, for example Notepad.
  2. Enter the query spelling suggestions that you want to add. Add one word or phrase per line.

Example of query suggestion list

  1. Save the file as a .txt file and encoding UTF-8.

Save query suggestion list

Now that you have your query suggestions file, the next step is to import it to SharePoint.

 

How to import a query suggestions file to SharePoint Online

  1. From the O365 Admin menu, select SharePoint.

O365 Admin menu

  1. On the SharePoint admin center, select search.

SharePoint admin center

 

  1. On the search administration page, select Query Suggestion Settings.

Query Suggestion Settings

  1. In the Language for suggestions phrases section, select the language of your query suggestions. In the Always suggest phrases section, select Import from text file.

Select Import from text file

  1. In the Text file with phrases section, select Choose File, and import your query suggestions file.

Select Choose File

  1. Select OK, and then Save Settings.

Save Settings

 

IMPORTANT: When you import query suggestions, existing query suggestions will be overwritten. If you haven’t previously imported any query suggestions, you have nothing to worry about. Automatically created query suggestions will not be overwritten when you import new ones. However, if you want to import additional query suggestions, you should export the existing query suggestions file, update it, and then re-import it.

 

How to import a query suggestions file to SharePoint Server 2013

  1. Go to Central Administration –> Manage service applications –> Search Service Application –> Query Suggestions.
  2. On the Query Suggestion Settings page, in the Always suggest phases section, select Import from text file.

Import query suggestions file

  1. On the Import phrases for query suggestions page, select Browse, and import your query suggestions file.

Browse for your query suggestions file

  1. Select OK, and then Save Settings.

Save Settings

 

IMPORTANT: When you import query suggestions, existing query suggestions will be overwritten. If you haven’t previously imported any query suggestions, you have nothing to worry about. Automatically created query suggestions will not be overwritten when you import new ones. However, if you want to import additional query suggestions, you should export the existing query suggestions file, update it, and then re-import it.

 

How to verify that your query suggestions are working

IMPORTANT: After you have uploaded your query suggestions file, it might take a few hours before your query suggestions are displayed.

To verify that your query suggestions are working correctly, in a search box, type two letters of a phrase from your query suggestions file. The query suggestions appear under the search box.

Cup of Joe query suggestion

Caffe Latte query suggestion

 

Additional resources

 

QuerySuggestions_coffee.txt

Comments (13)

  1. Dean Gross says:

    Thank you for providing SharePoint Online specific info, this is frequently not done and i appreciate the extra effort.

  2. Bella_Engen says:

    Hi Burcu,

    The "Did you mean?" feature is also knows as query spelling corrections. See this article for information on how you can use this feature: http://technet.microsoft.com/en-us/library/jj591607(v=office.15).aspx

    Note that query spelling corrections are not available for SharePoint Online.

    Hope this helps,
    Bella

  3. Bella_Engen says:

    Hi Reddy,

    1. I think what you're referring to is what's called query spelling corrections. Note that query spelling suggestions say "Did you mean?", not "Are you looking for?".
    Query suggestions are words that appear under the search box as the user types a query, Query spelling corrections are shown after the user has entered the query words.
    You can customize query spelling corrections in the Term Store. See this article for more information: https://technet.microsoft.com/library/jj591607.aspx

    2. Query spelling suggestions are the same for ordinary queries and people name queries.

    Hope this helps,
    Bella

  4. Bella_Engen says:

    Hi Manasi,

    I'm not quite sure if I understand your scenario, but I think you have to use the Never suggest phrases option. For example, say that your users are seeing the query suggestion "coffffee" when users start to type "co". The query suggestion that they should see is "coffee". In this case, you have to add "coffffee" to Never suggest phrases.

    You can never disable the dynamic query suggestions. They're based on a different dictionary that can't be edited.

    Hope this helps.

    Bella

  5. SC Vinod says:

    Excellent article!!!

  6. Rico Weber says:

    Hi Bella,

    you wrote

    … After you have uploaded your query suggestions file, it might take a few hours before your query suggestions are displayed. …

    There is a SharePoint Server 2013 job called 'Prepare query suggestions'. Run it and the suggestions are available for testing.

  7. Bella_Engen says:

    Hi Rico,

    Thanks for adding this information 🙂

    Please note that it's not possible to run this job in SharePoint Online.

    Bella

  8. Great article Bella!  Thanks for sharing.

  9. Kandru Venkatesh says:

    Thanks for sharng !

  10. Anonymous says:

    Pingback from Create and import query suggestions in SharePoint 2013 | Office 365 Singapore for Business – Win-Pro

  11. ChopFactory says:

    Thanks for sharing this info. Those who are newcomers for SharePoint will definitely get benefited as you have mentioned very nicely and clearly how to import a query suggestions file to SharePoint Server 2013.

    Keep it up!

  12. Burcu Seven says:

    Hi Bella,
    Thanks for sharing.
    Do you have a document about "Did You Mean?" static suggestions? Can we upload file in the same manner as written in this document? And is there a sharepoint service to pass "did you mean" words that are uploaded as txt file in our own admin page to FAST search
    system?
    Thanks!

  13. REDDY says:

    Hi Bella,

    Thanks for sharing this. Couple questions:

    1. How are these query suggestions different to suggestions that fall under 'Are you looking for..' i.e. People Name Suggestion' ? I believe people name suggestions are based on phonetic and fuzzy matching ? Is there any way to customize the results that come
    under 'Are you looking for..' similar to what you drafted ?

    2. How SharePoint Search Service differentiates the Query Suggestions and People Name Suggestions i.e. results for 'Are you looking for..'

    I hope my questions are not out of context.

    Thanks again !