On 1/25/2016 7:05 AM, Björn Keil wrote:
> I am using Solr 5.1 (within a Tomcat6 server) and am trying to find out how get information
from a Solr server about the exact time of the last commit and the total number of documents
in a given index, and I need to query this information in a scripted way.
>
> The total number of documents in a given index is the minor problem, of course, since
I can always send a query to the solr server with q=*:* and rows=0. But how I get the exact
time which is displayed as "last modification time" in the user interface in the overview
for the given index?
Send a request to /solr/corename/admin/mbeans ... depending on what
specific info you are after, you may or may not need a URL parameter of
stats=true.
http://host:port/solr/corename/admin/mbeans?stats=true
This includes all the info you asked for.
FYI, you really should not run Solr 5.x in Tomcat. It comes with a
container (Jetty) included, and has start scripts that use this
container. There is even an install script that works on most
non-Microsoft operating systems. Running Solr in the provided way will
yield a system that has been properly tuned for best results. A default
install of Tomcat is not tuned for Solr.
Thanks,
Shawn
|