在 Solr / Lucene 中记录搜索关键字

发布于 2024-08-18 19:56:33 字数 195 浏览 4 评论 0原文

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

  • Solr 已经可以做到这一点了吗?
  • 这些数据可以通过访问吗? Solr 查询?

谢谢。


更新 1

我开始认为我可能需要编写自己的 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.

  • Can Solr do this already?
  • Is this data accessible via. a Solr query?

Thanks.


Update 1

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

攒一口袋星星 2024-08-25 19:56:33

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

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 

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

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 

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!

愛上了 2024-08-25 19:56:33

几个月后......也许有人感兴趣:

http://karussell.wordpress.com/2010/10/27/feeding-solr-with-its-own-logs/

(如果您不使用默认的 solr,则需要调整日志解析器输出格式)

Months later ... maybe someone is interested:

http://karussell.wordpress.com/2010/10/27/feeding-solr-with-its-own-logs/

(you'll need to adapt the log parser if you are not using the default solr output format)

生寂 2024-08-25 19:56:33

SolrLogging wiki 页面表示您可以使用 JDK 日志记录(在 Solr 1.0 到 1.3 中)或 Solr 1.4 中的 slf4j 日志记录
关于您自己的 Solr 分析器 - 这取决于您的需求。在许多情况下,使用您自己的分析器有助于满足特定的检索要求。

The SolrLogging wiki page says you can use JDK logging (in Solr 1.0 to 1.3) or slf4j logging in Solr 1.4.
About your own Solr analyzer - it depends on your needs. In many cases, using your own analyzer helps for specific retrieval requirements.

雄赳赳气昂昂 2024-08-25 19:56:33

您可以查看类似 logstash 的内容来解析您的日志数据。

You can look at something like logstash to parse your log data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文