Logging Search Keywords in Solr / Lucene

后端 未结 4 2018
既然无缘
既然无缘 2020-12-31 06:19

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
4条回答
  •  星月不相逢
    2020-12-31 06:26

    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!

提交回复
热议问题