0

When accessing /ssp/admin/_layouts/SpUsageSSPSearchQueries.aspx, I can view the Top Queries Over Previous 30 Days report which shows all search terms that were used at least five times in the past month. How can I view the list of queries for other time periods (such as the 30 days prior to that, or for the past year?)

I believe the data is retained as the graphs on the Search Queries Report page show data for the previous 12 months.

Search queries over previous 12 months graph

If I have to retrieve the data directly from the SQL database, which table should I be looking for?

2 Answers 2

0

Typically, there's be warnings regarding support implications on accessing the SP databases directly but I since SP2007 is out of support scope, I think that's your default position now.

The database tables you'd need are: -

ANLDay ANLHistoricalSiteUsage ANLHistoricalWebUsage ANLHit ANLResource ANLUser ANLWeb

You may also want to edit a stored procedure that sets the 30 day period we're all so familiar with.

Info above, full credit and more indepth answer provided by Julian Stevens in his blog here

http://www.jstevensblog.com/post/Usage-Reports-longer-than-30-days-SharePoint-Log-Parsing.aspx

1
  • Thanks; I did come across that page during my Google search prior to posting the question, but didn't thoroughly read through it since it was referring to site metrics and not to search keywords. The section about the 30 day period is relevant, though. (Which unfortunately means that I can't retrieve the specific time period that I'm looking for retroactively.) The tables that store the search results are different, though. I was able to locate those elsewhere and will post the details. Commented Apr 7, 2016 at 16:50
0

Upon additional digging within the SQL database, I was able to locate the tables containing the search queries. The relevant SQL tables for the search results are MSSQLogQuerySummary and MSSQLogQueryString.

MSSQLogQueryString contains a list of all historical search queries, along with the most recent date that keyword was used. However, MSSQLogQuerySummary only contains the references to MSSQLogQueryString for the past 30 days, so it is not possible to retroactively determine the count of query usage for prior months (without restoring an older copy of the database from a backup and then manually reporting on that data.)

Query string table:

MSSQLogQueryString

Query summary table:

MSSQLogQuerySummary

It may be possible to change the stored procedures to prevent it from truncating the summary table every 30 days; I did not attempt to do this as I do not have a suitable test environment available at the moment. If more than 30 days was present in the database, it would then be possible to run a report based on the correlation between the two tables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.