Part of the Drupal.org re-design involves the creation of a UX toolkit offering better search, and using the results of searches to inform the information architecture.

This page has existed for a while: http://drupal.org/search-queries in an unpublished state. The concern was that this is a very intensive query and traffic to this page would have a serious impact on performance. We now need a subset of this information to ensure that the most popular searched topics can be found easily. Can we modify this page so it uses a cache, or has less of a performance impact?


$result = db_query("select message, count(message) as count from watchdog where type = 'search' and uid = 0 group by message order by count desc limit 300");
print '<div class="column-left"><h2>Anonymous users</h2><ul>';
while ($s = db_fetch_object($result)) {
  preg_match('!<em>(.*?)</em>!', $s->message, $matches);
  print '<li>'. $matches[1] .' ('. $s->count .')</li>';
}
print '</ul></div>';

$result = db_query("select message, count(message) as count from watchdog where type = 'search' and uid != 0 group by message order by count desc limit 300");
print '<div class="column-right"><h2>Authenticated users</h2><ul>';
while ($s = db_fetch_object($result)) {
  preg_match('!<em>(.*?)</em>!', $s->message, $matches);
  print '<li>'. $matches[1] .' ('. $s->count .')</li>';
}
print '</ul></div>';

CommentFileSizeAuthor
#5 Search queries.jpg272.72 KBAmazon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Amazon’s picture

Status: Active » Fixed

Khalid added this code into the drupalorg module. Thank-you!

http://drupal.org/authenticated-search-queries

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Amazon’s picture

Status: Closed (fixed) » Active

I'd like to add a link to the search results beside each term. Is there a way to see which terms get clicked on from the search results?

It would be helpful to have more insight into search results to inform our IA for the redesign.

Kieran

kbahey’s picture

I am not sure I can visualize what you need, nor how it would work. Google does that by tracking the onmousedown event, then triggering some javascript that registers the click.

However, you can already get the info you want for d.o from the Apache log. Just filter by the referer http://drupal.org/search/node/ and you know that it was clicked from the search page. A perl script can do that for sure.

Amazon’s picture

FileSize
272.72 KB

Add a link to search results, so that people can see what results are provide. Thanks for the tip about search the Apache logs.

Only local images are allowed.

silverwing’s picture

Queue Cleanup

Amazon, does anything else need to be done with this? Tag for the redesign team?

Amazon’s picture

Project: Drupal.org site moderators »
Component: Site organization » SEO

Moving over to the redesign queue. This is probably something we can now get from Solr easily.

joegml’s picture

Issue tags: +drupal.org redesign

As kbahey says, much goodness resides in the d.o apache logs and is grokkable by a perl script. I had done some earlier work on finding the most popular downloads via a perl script accessing the analog data files. Analog files contain no IP addresses or agent identifiers and so no spam filtering is possible on them. I think the downloads popularity is now addressed with the update_status module, but issues still remain as to how accurate the reported numbers are.

In terms of this topic kbahey is basically right, it should be a straightforward perl script and it seems to me this would be a good way to track searches: the raw data's already there. The perl script could chug away in the background and digest Apache logs in the CPUs slow time. One dicey bit is sorting out the robots: the Apache logs list all hits. Do robots enter search phrases?

drumm’s picture

Status: Active » Fixed

Looks like Google Analytics is tracking this.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.