Search suggestion not showing normal suggestion

HI

We have configured search center and enabled query suggestion.When we type it only show people suggestion and no other suggestion is shown.

I have even tried searching some general item and click on link multiple times (more than 6) but still it didn't work.I have run both the timer job.

I have tested suggestion using search query tool and it also show people suggestion only.

Then I started deep diving into this and found that link store database store the clicks query logging timer job add the clicks in the table of link store database.After that when I run prepare query suggestion Nothing happens.Even I don't get any error.

when I try to type some letter of that word no suggestion crops up

Earlier In 2010 there was particular table in search db where it used to store the search suggestion but here I cannot find such thing 

Any help on how to debug will be appreciated 


April 30th, 2015 7:28am

Hi,

Query spelling suggestions are words that appear below the search box as a user types a query. SharePoint automatically creates a query suggestion when youve clicked a search result for a query at least six times. For example, if youve entered the query word coffee and then clicked a search result six times, coffee automatically becomes a query suggestion.

Automatic query suggestions are generated daily for each result source and each site collection, so the query suggestions can be different for different result sources and site collections.

If you enabled the Search Suggestion according to this Technet, please make sure prepare query Suggestions timer job completed successfully, if not then run the below power-shell and then test it.

Start-SPTimerJob -Identity "prepare query suggestions"

Reference:

http://social.technet.microsoft.com/wiki/contents/articles/16640.sharepoint-2013-tips-for-troubleshooting-search-suggestions.aspx

https://support.office.com/en-us/article/Customize-query-suggestions-in-SharePoint-search-9ef0f859-3b92-41e9-b393-cb43d6094c7b

http://blogs.technet.com/b/tothesharepoint/archive/2013/12/05/create-and-import-query-suggestions-in-sharepoint-2013.aspx

Best Regards,

Eric

Free Windows Admin Tool Kit Click here and download it now
May 4th, 2015 4:08am

Hi

I agree with you that on clicking six times you get in search suggestion.I have run the timer job as well as read those blogs but nothing worked.

I search documents and when I hover I can see record page click event getting fired through fiddler but on clicking I cannot see any such click request going to server through fiddler

So I believe that when we hover six times it records those query string.

I can see the query string in "[MSSQLogPageImpressionQuery]" table more than 6 times but after that when I run prepare query definition timer job nothing happens.Even I don't get any error logs in ULS

Any other comments how to proceed

May 4th, 2015 8:47am

Hi,

Could you add phrases that should always be used as query suggestions ?

Here are the steps:


1.Verify that the user account that is performing this procedure is an administrator for the Search service application.
2.Open the Query Suggestion Settings page.

  a.On the home page of the SharePoint Central Administration website, in the Application Management section, click Manage service applications.
  b.On the Manage Service Applications page, click the Search service application.
  c.On the Search Administration Page, in the Queries and Results section, click Query Suggestions. The Query Suggestion Settings page opens.

3.In the Language for suggestion phrases section, select the processing language for the query suggestions that you always want to suggest.
4.In the Always suggest phrases section, click Import from text file. Browse to the file that you want to import and click OK.
5.Click Save Settings.

Also please make sure Show Query Suggestions option is enabled in search box web part properties:

Best Regards,

Free Windows Admin Tool Kit Click here and download it now
May 5th, 2015 7:20am

HI

I have tried adding the data using text file and it is working fine.They appear in search suggestion but it doesn't add data using click method.

I tried some new word but that didn't appear in suggestion using click method.This is really confusing that it import method works and click method is not working

Any idea how to debug


  • Edited by agarwal 19 hours 47 minutes ago More clarification
May 5th, 2015 7:33am

HI

I have tried adding the data using text file and it is working fine.They appear in search suggestion but it doesn't add data using click method.

I tried some new word but that didn't appear in suggestion using click method.This is really confusing that it import method works and click method is not working

Any idea how to debug


  • Edited by agarwal Tuesday, May 05, 2015 11:33 AM More clarification
Free Windows Admin Tool Kit Click here and download it now
May 5th, 2015 11:32am

HI

I have tried adding the data using text file and it is working fine.They appear in search suggestion but it doesn't add data using click method.

I tried some new word but that didn't appear in suggestion using click method.This is really confusing that it import method works and click method is not working

Any idea how to debug


  • Edited by agarwal Tuesday, May 05, 2015 11:33 AM More clarification
May 5th, 2015 11:32am

HI

I have tried adding the data using text file and it is working fine.They appear in search suggestion but it doesn't add data using click method.

I tried some new word but that didn't appear in suggestion using click method.This is really confusing that it import method works and click method is not working

Any idea how to debug


  • Edited by agarwal Tuesday, May 05, 2015 11:33 AM More clarification
Free Windows Admin Tool Kit Click here and download it now
May 5th, 2015 11:32am

Hi,

It seems that your SharePoint Search cannot implement the tracking of click through events by users from the search results page.

For your issue, please enable query logging in the Search Service Application associated with the web application.  This can be enabled by navigating to the Search Service Application in Central Administration and clicking the Enable link next to Query Logging.

Reference:

http://sharepointfieldnotes.blogspot.com/2011/06/life-and-times-of-sharepoint-search.html

Best Regards,

Eric

May 5th, 2015 10:27pm

Hi,

Search logging is on as you can see below.Any other thing I need to check



Free Windows Admin Tool Kit Click here and download it now
May 6th, 2015 1:41am

Hi,

In SharePoint,queries are logged by calling the RecordClick method of the search web service. The Microsoft.Office.Server.Search.WebControls.SearchResultsBaseWebPart webpart, which is used to render search results, makes the magic happen.

When the page rendered by Core Search Results Web Part  is loaded a function is registered for the onlick event of all HTML link elements whos ID matches a RegExp filter. The page's unload event is also registered to send a soap request containing a serialized Microsoft.Office.Server.Search.Query.QueryInfo object to the search web service RecordClick method. The properties of the QueryInfo object is then stored in the Share service provider database, in the MSSQLogUnprocessed and MSSQLogNonClickedUnprocessed tables of Query_SSA_DB.

For your issue, please test the code as below which shows how to use RecordClick and QueryInfo OM for query logging and auto query suggestion preparation.

using (SPSite site = new SPSite("http://mysite"))
{

    SPServiceContext serviceContext = SPServiceContext.GetContext(site);
    SearchServiceApplicationProxy searchAppProxy = ((SearchServiceApplicationProxy)SearchServiceApplicationProxy.GetProxy(serviceContext));

    for (int i = 0; i < 6; i++)         // You need at least 6 here to make a query popular
    {
        string queryStr = "testme";
        string queryId = Guid.NewGuid().ToString();
        string sessionId = Guid.NewGuid().ToString();
        string clickedUrl = "http://mysite/Shared%20Documents/testme.txt";
                    
        QueryInfo info = new QueryInfo();
        info.QueryGuid = queryId;
        info.SiteGuid = site.ID.ToString();
        info.SessionId = sessionId;
        info.UserName = System.Threading.Thread.CurrentPrincipal.Identity.Name;
        info.QueryString = queryStr;
        info.StartItem = 1;
        info.ClickTime = DateTime.Now;
        info.ClickedUrl = clickedUrl;
        info.ResultsUrl = "http://mysite/fast/Pages/results.aspx?k=testme";
        info.ClientType = QueryLogClientType.ObjectModel;
        info.SearchTime = DateTime.Now;      

        // Send a Click QueryInfo
        info.LogType = QueryLogType.Click;
        searchAppProxy.RecordClick(info);    

        // Send a Query QueryInfo
        info.LogType = QueryLogType.Query;
        searchAppProxy.RecordClick(info);   

     }
} 

CheckPoints after running the demo code:

1. Every 5 minutes or so there's a watch thread copying RecordClick QueryInfo into the "MSSQLogUnprocessed" table of your Query_SSA_DB. Make sure you see records with both 0 (Click) and 1 (Query) in "logType" column.

2. Run the "Query Logging" timer job manually and wait a bit, you'll see the "MSSQLogUnprocessed" table is cleaned up, while "MSSQLogQueryString", "MSSQLogClicks", and "MSSQLog" (other updated tables are omitted) tables are updated with latest Click and Query records.

3. Run the following SQL to verify if the query string is qualified as Query Suggestion Candidate.

=======================

SELECT TopQueries.queryId, QueryCount, queryString FROM    ( SELECT L.queryId, COUNT(*) AS QueryCount FROM (SELECT q.queryId, c.clickedUrlId FROM MSSQLog as q INNER JOIN MSSQLogClicks as c  ON q.queryGuid = c.queryGuid) as L WHERE L.clickedUrlId IS NOT NULL GROUP BY queryId HAVING COUNT(*) > 5) as TopQueries JOIN MSSQLogQueryString ON TopQueries.queryId = MSSQLogQueryString.queryId

=======================

 If the query string is returned from SQL above, you can safely run the "Prepare Query Suggestions" timer job. You'll find the "MSSQLogSessionSearchCounts" and "MSSQLogSearchCounts" tables will be added with that new popular query. Turn your "SharePoint Server Search" into Verbose trace logging mode and grep for "GetPopularQueries" in ULS Viewer, you'll also see the new query suggestion candidates in ULS log.

4. Run "Get-SPEnterpriseSearchQuerySuggestionCandidates" against your Query SSA and you'll see the new query suggestion candidate has been added.

Reference:

http://blogs.technet.com/b/bestleon/archive/2011/10/26/use-recordclick-to-add-queryinfo-to-auto-query-suggestion-in-sharepoint-2010.aspx

For more information, you can have a look at the article:

Search Query Shared Services Protocol

Search Service Database Query Protocol Specification

https://msdn.microsoft.com/en-us/library/jj633109.aspx

Best Regards,

Eric

May 7th, 2015 4:09am

HI

Thanks for your info but I think there has been confusion here.The commands which you have given here are for sharepoint 2010 search.

We have Sharepoint 2013 search environment

Sharepoint 2013 show recordclick has obsolete function and ask us to use recordpageclick method.

Secondly there is no database as sqllog and clicks which is mentioned in DB query so it won't work.They have changed the structure in DB for search.

I have done some investigation and I found that in Sharepoint 2013 "querylogging"  timer job store the data in Linkstore database and not the main search db.

"Prepare query suggestions" then picks the data from this Linkstore DB and update it to main search DB in [MSSQLogSessionSearchCounts] this table.From that table the data gets populated to other tables.

Here the part which I didn't understand on what condition Sharepoint fetches the data from linkstore DB and update the main search DB due to which I am stuck

Any help would be appreciated

To update more I was going through query shared service protocol and I found information related to recordpageclick method in that.

When I was seeing its wsdl I saw a property "clicktype" needs to be sent.This click type which I see being sent through fiddler is "Hover" and this "recordpageclick" method is called only on hover.

When I click that link nothing happens and no recordpageclick info goes to the server which is weird.Is this can be the issue?

I am using search center url and have not customized any display template.The data gets displayed in default tempaltes

  • Edited by agarwal 18 hours 49 minutes ago More info
Free Windows Admin Tool Kit Click here and download it now
May 7th, 2015 8:05am

HI

Thanks for your info but I think there has been confusion here.The commands which you have given here are for sharepoint 2010 search.

We have Sharepoint 2013 search environment

Sharepoint 2013 show recordclick has obsolete function and ask us to use recordpageclick method.

Secondly there is no database as sqllog and clicks which is mentioned in DB query so it won't work.They have changed the structure in DB for search.

I have done some investigation and I found that in Sharepoint 2013 "querylogging"  timer job store the data in Linkstore database and not the main search db.

"Prepare query suggestions" then picks the data from this Linkstore DB and update it to main search DB in [MSSQLogSessionSearchCounts] this table.From that table the data gets populated to other tables.

Here the part which I didn't understand on what condition Sharepoint fetches the data from linkstore DB and update the main search DB due to which I am stuck

Any help would be appreciated

To update more I was going through query shared service protocol and I found information related to recordpageclick method in that.

When I was seeing its wsdl I saw a property "clicktype" needs to be sent.This click type which I see being sent through fiddler is "Hover" and this "recordpageclick" method is called only on hover.

When I click that link nothing happens and no recordpageclick info goes to the server which is weird.Is this can be the issue?

I am using search center url and have not customized any display template.The data gets displayed in default tempaltes

  • Edited by agarwal Thursday, May 07, 2015 12:30 PM More info
May 7th, 2015 12:04pm

HI

Thanks for your info but I think there has been confusion here.The commands which you have given here are for sharepoint 2010 search.

We have Sharepoint 2013 search environment

Sharepoint 2013 show recordclick has obsolete function and ask us to use recordpageclick method.

Secondly there is no database as sqllog and clicks which is mentioned in DB query so it won't work.They have changed the structure in DB for search.

I have done some investigation and I found that in Sharepoint 2013 "querylogging"  timer job store the data in Linkstore database and not the main search db.

"Prepare query suggestions" then picks the data from this Linkstore DB and update it to main search DB in [MSSQLogSessionSearchCounts] this table.From that table the data gets populated to other tables.

Here the part which I didn't understand on what condition Sharepoint fetches the data from linkstore DB and update the main search DB due to which I am stuck

Any help would be appreciated

To update more I was going through query shared service protocol and I found information related to recordpageclick method in that.

When I was seeing its wsdl I saw a property "clicktype" needs to be sent.This click type which I see being sent through fiddler is "Hover" and this "recordpageclick" method is called only on hover.

When I click that link nothing happens and no recordpageclick info goes to the server which is weird.Is this can be the issue?

I am using search center url and have not customized any display template.The data gets displayed in default tempaltes

  • Edited by agarwal Thursday, May 07, 2015 12:30 PM More info
Free Windows Admin Tool Kit Click here and download it now
May 7th, 2015 12:04pm

HI

Thanks for your info but I think there has been confusion here.The commands which you have given here are for sharepoint 2010 search.

We have Sharepoint 2013 search environment

Sharepoint 2013 show recordclick has obsolete function and ask us to use recordpageclick method.

Secondly there is no database as sqllog and clicks which is mentioned in DB query so it won't work.They have changed the structure in DB for search.

I have done some investigation and I found that in Sharepoint 2013 "querylogging"  timer job store the data in Linkstore database and not the main search db.

"Prepare query suggestions" then picks the data from this Linkstore DB and update it to main search DB in [MSSQLogSessionSearchCounts] this table.From that table the data gets populated to other tables.

Here the part which I didn't understand on what condition Sharepoint fetches the data from linkstore DB and update the main search DB due to which I am stuck

Any help would be appreciated

To update more I was going through query shared service protocol and I found information related to recordpageclick method in that.

When I was seeing its wsdl I saw a property "clicktype" needs to be sent.This click type which I see being sent through fiddler is "Hover" and this "recordpageclick" method is called only on hover.

When I click that link nothing happens and no recordpageclick info goes to the server which is weird.Is this can be the issue?

I am using search center url and have not customized any display template.The data gets displayed in default tempaltes

  • Edited by agarwal Thursday, May 07, 2015 12:30 PM More info
May 7th, 2015 12:04pm

Hi,

To narrow down your issue, please create a new Enterprise Search Center and see whether the page link lick event can be recorded.

If the issue persists, I can recommend you delete your search service application and reprovision it.

Best Regards,

Eric

Free Windows Admin Tool Kit Click here and download it now
May 12th, 2015 1:20am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics