lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: detect Lucene version
Date Fri, 08 Oct 2010 12:50:23 GMT
There is no easy way to get a global Lucene index version, as each segment
has its own versions and in each segment, even each file type has its own
version. There is an issue open, to also store the Lucene version in the
segments file itself after each update (so get the "newest" file type across
the whole index).

About 3.0: The file format in 3.0 didn't change, it is the same as in 2.9.
Only for stored fields, the version number was increased to easily detect a
segment, that has no compressed fields anymore and does not need to be
re-merged to remove compression. From user code, this version number is not
easily detectable.

An easy way is t use the CheckIndex tool, that will print all version
information in the diagnostics data for each segment. Please note, for 3.0
indexes it still prints 2.9 on the to-level index information (see above).

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Ivan Vasilev [mailto:ivasilev@sirma.bg]
> Sent: Friday, October 08, 2010 8:35 AM
> To: LUCENE MAIL LIST
> Subject: detect Lucene version
> 
>   Hi Guys,
> 
> Is there way to detect org.apache.lucene.util.Version of an index having
> IndexReader or just FSDirectory?
> I know I can open segments file and read the proper bytes according to
rules of
> creating it but is there more smart way to do this without using
> RandomAccessFile or something like this.
> Actually I need just to know if index is pre Lucene 3_0 or 3_0 (or later).
> 
> Thanks,
> Ivan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message