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.
Thanks.
I'm starting to think I might need to write my own Solr analyzer?
To view the Apache Solr log: Sign on to the Solr pod. Go to /home/solr-anchor/solr/server/logs and view the file solr. log .
The main query for a solr search is specified via the q parameter. Standard Solr query syntax is the default (registered as the “lucene” query parser). If this is new to you, please check out the Solr Tutorial. Adding debug=query to your request will allow you to see how Solr is parsing your query.
Solr works by gathering, storing and indexing documents from different sources and making them searchable in near real-time. It follows a 3-step process that involves indexing, querying, and finally, ranking the results – all in near real-time, even though it can work with huge volumes of data.
There is solr. log file under /var/log/ folder. It records all the solr related logs.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With