Bevan
Bevan

Reputation: 281

Sitecore return "Popular searches" while using Lucene Search?

I have a request to return a list of the most popular search terms used when searching a Sitecore site.

I have no idea how to implement this sort of function using Sitecore or whether Sitecore has this kind of functionality all ready. I can't find any documentation detailing this.

I am currently using search based of the LuceneSearch module (http://trac.sitecore.net/LuceneSearch) but altered to bind to a ListView for easy pagination.

At the moment I am probably just going to build a standalone function/class to update an XML file or something unless someone is able to point me in the correct direction...?

Upvotes: 2

Views: 1043

Answers (4)

AndrewThompson
AndrewThompson

Reputation: 452

Sitecore has an out of the box "site search" report in the executive insight dashboard, this will give you an indication of what search terms are driving the most visits and of course engagement value. You just need to configure it by registering a page event on the search page and passing the query otherwise sitecore wouldnt know what form field constitutes a search. See this post it explains it in more detail. For more information you can download the analytics configuration reference document from sdn.http://sdn.sitecore.net/upload/sitecore6/65/engagement_analytics_configuration_reference_sc65-usletter.pdf And dont forget for performance sitecore caches the reports at various levels so during development it may be handy to know how to force a cache update, I talk about this in the following blog post: http://andytsitecore.blogspot.co.uk/2013/10/sitecore-dms-and-analytics.html

Upvotes: 0

Alex Shyba
Alex Shyba

Reputation: 1262

I would frankly use OMS for that - this is what it is designed to do. No need of separate database. Just register the search events via API with OMS. There is an out of the box Search report. May require some tweaking, but this seems to be the most out of the box solution.

Take a look here for more details.

Upvotes: 3

Mark Ursino
Mark Ursino

Reputation: 31435

Very interesting question. One thing you could do it have another database to store these search queries. An insert into this DB would not be very difficult and would get around the issue of locking on a XML file. Maybe insert the search query into a DB table then to get the top results just pull the top x rows ordered by that query field. As Mark Cassidy said before, maybe normalize the data before inserting it.

You could isolate this work on your search layout (or sublayout) so it runs on a specific part of the site, not on every page.

Upvotes: 1

Mark Cassidy
Mark Cassidy

Reputation: 5860

I don't know of any standard functionality in Sitecore that would help you achieve this, so you will probably have to approach this from ground up - unless someone else in here is able to point to a package deal somewhere :-)

Solving this, really breaks down into two tasks

1) Collecting search term information. Whenever a user enters a search term in the searchbox that I assume you have; normalise it and store it in a SQL table (essentially a [term] [count] type table. Update the counter on terms you already store.

By normalising, I mean lowercasing it and so on - possibly breaking each search term (word) down and storing them one for one if that is what your solution calls for (probably not the route I would go)

2) Realtime retreiving information from the table, based on what the user is typing in the searchbox. Assuming you want some sort of "amazon-like" - also found on almost all major search engines nowadays - autocompletion. I normally implement these in a web service that then gets called by Ajax, JQuery or whatever rich client implementation you prefer.

As for updating an XML file, I think locking issues and performance would kill that solution; though it could perhaps be made to work on a very small scale.

Sorry that I can't be more specific in my response, but your question is very open-ended.

Upvotes: 1

Related Questions