在 Solr/Lucene 中记录搜索关键字 [英] Logging Search Keywords in Solr / Lucene

查看:25
本文介绍了在 Solr/Lucene 中记录搜索关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Solr 的新手,正在寻找一种将搜索(或关键字)记录到日志文件或数据库的方法,以便我可以分析数据的可视化.

I'm new to Solr and am looking for a way to record searches (or keywords) to a log file or database so that I can then analyse for data visualisation.

  • Solr 可以这样做吗?
  • 是否可以通过以下方式访问此数据.Solr 查询?

谢谢.

我开始认为我可能需要编写自己的 Solr 分析器?

I'm starting to think I might need to write my own Solr analyzer?

推荐答案

我认为这取决于您要记录的内容?您是否只想记录用户提交的查询以及结果?如果它只是人们在搜索什么",那么您在 servlet 容器记录的 q 参数中有该数据.如果您使用默认的 Jetty 设置,请查看 ./logs/*request.log.您将看到如下所示的行:

I think it depends on what you are looking to log? Are you just looking to record the queries users are submitting as well as the results? If it's just "what are folks searching for" then you have that data in the q parameter that is logged by the servlet container. If you are using the default Jetty setup, look at ./logs/*request.log. You will see lines like:

0:0:0:0:0:0:0:1%0 -  -  [21/01/2010:15:08:29 +0000] "GET /solr/select/?q=*:*&qt=geo&lat=45&long=15&radius=10 HTTP/1.1" 200 197 

在这种情况下,您可以解析出用户正在执行 q=: 搜索!使用诸如 AWStats 之类的工具来解析您的日志并进行分析.这至少是一种快速简便的获取信息的方法!

In this case, you can parse out that the user was doing a q=: search! Use a tool like AWStats to parse your logs and do the analysis. It's at least a quick and easy way to get some information!

这篇关于在 Solr/Lucene 中记录搜索关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆