本文介绍了在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中记录搜索关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 10:42
查看更多