lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lokesh Madan <mail2lok...@gmail.com>
Subject Re: How to get the index last modification date ?
Date Sun, 09 Apr 2017 00:40:40 GMT
Can’t you introduce the field ? It should be straight forward, an every time you update the
index, make sure to update the field. IndexWriter has setCommitData api, which you can call
overtime you update/flush the indices.

> On Apr 8, 2017, at 2:30 PM, Jean-Claude Dauphin <jc.dauphin@gmail.com> wrote:
> 
> Thank you Ahmet for the suggestion.
> 
> I checked the LukeRequestHandler.java code source and the it looks like
> this:
> 
> String s = reader.getIndexCommit().getUserData().get(
> SolrIndexWriter.COMMIT_TIME_MSEC_KEY);
>    if (s != null) {
>      indexInfo.add("lastModified", new Date(Long.parseLong(s)));
>    }
> 
> But this is the Solr code and not the Lucene code
> 
> public class SolrIndexWriter extends IndexWriter {
>    ....
> 
>  /** Stored into each Lucene commit to record the
>   *  System.currentTimeMillis() when commit was called. */
>  public static final String COMMIT_TIME_MSEC_KEY = "commitTimeMSec";
> 
> And I don't find this map key into Lucene code. Otherwise I can test the
> following code
> 
>     String s = indexReader.getIndexCommit().getUserData().get("
> commitTimeMSec");
>      if (s != null) {
>                lastModified = new Date(Long.parseLong(s)).toString();
>      }
> 
> Thanks again Ahmet,
> 
> Jean-Claude
> 
> 
> 
> On Sat, Apr 8, 2017 at 10:31 PM, Ahmet Arslan <iorixxx@yahoo.com.invalid>
> wrote:
> 
>> 
>> Hi Jean,
>> How about LukeRequest handler? Many of the information displayed on the
>> admin screen comes from it.https://wiki.apache.org/solr/LukeRequestHandler
>> 
>> Ahmet
>> On Sunday, April 9, 2017, 2:21:38 AM GMT+3, Jean-Claude Dauphin <
>> jc.dauphin@gmail.com> wrote:
>> Hello,
>> 
>> I need to check the index last modification date to count the number of
>> indexed terms only if tthe index has changed.
>> 
>> Any idea or suggestion on how to do this.
>> 
>> Thank you in advance.
>> 
>> Best wishes,
>> 
>> --
>> Jean-Claude Dauphin
>> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message