SharePoint Developer Center >
SharePoint Products and Technologies Forums
>
SharePoint - Search
>
Others who searched [SearchKeyword] also searched
Others who searched [SearchKeyword] also searched
Hi folks,
I'm looking for some solution which will display what others who searched [SearchKeyword] also searched...
This list should be shown after the user search for some string.
Like in MSDN(the only differences is that I need Search Keywords and not Download Keywords):Thank you,
Yair
- Edited byMike Walsh MVPMVP, ModeratorMonday, November 02, 2009 12:23 PMtrailin ... deleted - trying to attract attention to post
- Moved byMike Walsh MVPMVP, ModeratorMonday, November 02, 2009 12:24 PMsearch q (From:SharePoint - Development and Programming)
All Replies
- Hi,
I'm afraid it is not possible out of the box in MOSS 2007. You have to extend the logging for the search and add the requested logic to that.
Alternatively you can look for an existing 3rd party tool / product for SharePoint that supports this feature.
Peter - Hi Peter,
How can I log user's search events? Any idea?
Yair - Hi Yair,
If you want to use the built-in web parts for search, then it is not so easy, as the classes behind them are sealed (as I remember), so you cannot extend them simply by inheriting your custom web parts. There is also a minimal logging and reports about search OOB, but we found that not very useful and created a custom search solution with our specific web parts, log tables and reporting user interface.
You can try to catch the search parameters on the search result page (for example, by customizing the XSLT of the core results web part and extendig it with managed assembly call that logs the search parameters), but it may a drawback that paging forth and back on the results may cause multiple logging. Furthermore, I'm not sure if the search parameters are included in the result XML.
Some links that may help your work:
Customizing Search Results with Custom XSLTs in SharePoint Server 2007
http://msdn.microsoft.com/en-us/library/bb896018.aspx
Custom XSLT for the Search Core Results Web Part
http://www.u2u.info/Blogs/Patrick/Lists/Posts/Post.aspx?ID=1669
Extend your XSLT with custom functions
http://our.umbraco.org/wiki/reference/xslt/extend-your-xslt-with-custom-functions
Extending XSLT using C#
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=64
Peter - Hi Peter,
You think that HTTPModule can maybe help?
I need username & search-string parameters for my table.
Yair - Hi Yair,
It is a long time ago when I was deep in HttpModule, but yes, that should work theoretically.
Regarding the username, I don't know how sensitive your customer is, but because of privacy it would be better to log the session ID, or something similar instead of the user name.
Peter Hi Yair,
If you want to use the built-in web parts for search, then it is not so easy, as the classes behind them are sealed (as I remember), so you cannot extend them simply by inheriting your custom web parts. There is also a minimal logging and reports about search OOB, but we found that not very useful and created a custom search solution with our specific web parts, log tables and reporting user interface.
You can try to catch the search parameters on the search result page (for example, by customizing the XSLT of the core results web part and extendig it with managed assembly call that logs the search parameters), but it may a drawback that paging forth and back on the results may cause multiple logging. Furthermore, I'm not sure if the search parameters are included in the result XML.
Some links that may help your work:
Customizing Search Results with Custom XSLTs in SharePoint Server 2007
http://msdn.microsoft.com/en-us/library/bb896018.aspx
Custom XSLT for the Search Core Results Web Part
http://www.u2u.info/Blogs/Patrick/Lists/Posts/Post.aspx?ID=1669
Extend your XSLT with custom functions
http://our.umbraco.org/wiki/reference/xslt/extend-your-xslt-with-custom-functions
Extending XSLT using C#
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=64
Peter
Hi Peter,
please tell me, the log tables which you've created are in a separated sql database?
I tell you what is my idea, I would like to create a new web part that logging user's searches and also displaying what others search, the resources for this would be sql database tables(for logging information) and WSS API for getting the current user and so on..- Peter?
- Hi,
Sorry, I'm just processing my backlog in the forum. :-)
So, to tell the truth, our custom log tables were in one of the SharePoint databases (it was the database that contains SharePoint own log tables) for the sake of simplicity, but it is not a really nice solution. Would be at better place in a separate DB.
Peter Thanks Peter,
Another question, when searching in SharePoint there is a QueryString: k=["keyword"].
But when searching with the advanced search, there is no QueryString. Do you know how can I get the search keyword when searching using the advanced search? Maybe with Forms Variables Collection?
Yair- Hi Yair,
You can check if these info is posted back in the form variables collection, but it might be included in the viewstate, and so not trivial to extract by an external component.
Peter - Therefore I apparently need to use the results XSLT in order to pass the search keyword into some assembly.
The question is how can I do it, it's sounds like a space technology :) - Hi,
May be not a space technology, but you should consider creating your own custom search webparts where you have full control what happens, including logging. It might be easier than bothering with the built-in ones.
Peter - Yes, this is actually what I've started to create, the only issue that is bothering me right know is the Search-Keyword parameter from the advanced search.


