I don't think there is anything low level in Lucene that will specifically 
output anything like lastOptimized() to you, since it can be setup a few ways.  

Your best bet is probably adding a postOptimize hook and dumping it to log / 
file / monitor / etc, probably something like ...

<listener event="postCommit" class="solr.RunExecutableListener">
      <str name="exe">lastOptimize.sh</str>
      <str name="dir">solr/bin</str>
      <bool name="wait">true</bool>
</listener>
 
Or writing to a file and reading it back into the admin if you need to display 
it there.

More @ http://wiki.apache.org/solr/SolrConfigXml#Update_Handler_Section

- Jon

On Apr 22, 2010, at 11:16 AM, Shawn Heisey wrote:

> On 4/21/2010 1:24 PM, Shawn Heisey wrote:
>> Is it possible to issue some kind of query to a Solr core that will return 
>> the last time the index was optimized?  Every day, one of my shards should 
>> get optimized, so I would like my monitoring system to tell me when the 
>> newest optimize date is more than 24 hours ago.  I could not find a way to 
>> get this.  The /admin/cores page has a lot of other useful information, but 
>> not that particular piece.
> 
> I have found some other useful information on the stats.jsp page, like the 
> number of segments, the size of the index on disk, and so on.  Still have not 
> been able to locate the last optimize date, which would simply be the 
> timestamp on the earliest disk segment.
> 
> Thanks,
> Shawn
> 

Reply via email to