Class Version
- java.lang.Object
-
- org.apache.lucene.util.Version
-
public final class Version extends Object
Use by certain classes to match version compatibility across releases of Lucene.WARNING: When changing the version parameter that you supply to components in Lucene, do not simply change the version at search-time, but instead also adjust your indexing code to match, and re-index.
-
-
Field Summary
Fields Modifier and Type Field Description intbugfixBugfix number, incremented on release branchesstatic VersionLATESTWARNING: if you use this setting, and then upgrade to a newer release of Lucene, sizable changes may happen.static VersionLUCENE_8_0_0Deprecated.(9.0.0) Use lateststatic VersionLUCENE_8_1_0Deprecated.Use lateststatic VersionLUCENE_8_1_1Deprecated.Use lateststatic VersionLUCENE_8_10_0Deprecated.Use lateststatic VersionLUCENE_8_10_1Deprecated.Use lateststatic VersionLUCENE_8_11_0Deprecated.(8.11.1) Use lateststatic VersionLUCENE_8_11_1Deprecated.Use lateststatic VersionLUCENE_8_11_2Deprecated.Use lateststatic VersionLUCENE_8_11_3Deprecated.Use lateststatic VersionLUCENE_8_11_4Deprecated.Use lateststatic VersionLUCENE_8_12_0Deprecated.Use lateststatic VersionLUCENE_8_2_0Deprecated.Use lateststatic VersionLUCENE_8_3_0Deprecated.Use lateststatic VersionLUCENE_8_3_1Deprecated.Use lateststatic VersionLUCENE_8_4_0Deprecated.Use lateststatic VersionLUCENE_8_4_1Deprecated.Use lateststatic VersionLUCENE_8_5_0Deprecated.Use lateststatic VersionLUCENE_8_5_1Deprecated.Use lateststatic VersionLUCENE_8_5_2Deprecated.Use lateststatic VersionLUCENE_8_6_0Deprecated.Use lateststatic VersionLUCENE_8_6_1Deprecated.Use lateststatic VersionLUCENE_8_6_2Deprecated.Use lateststatic VersionLUCENE_8_6_3Deprecated.Use lateststatic VersionLUCENE_8_7_0Deprecated.Use lateststatic VersionLUCENE_8_8_0Deprecated.Use lateststatic VersionLUCENE_8_8_1Deprecated.Use lateststatic VersionLUCENE_8_8_2Deprecated.Use lateststatic VersionLUCENE_8_9_0Deprecated.Use lateststatic VersionLUCENE_9_0_0Deprecated.(9.1.0) Use lateststatic VersionLUCENE_9_1_0Deprecated.(9.2.0) Use lateststatic VersionLUCENE_9_10_0Deprecated.(9.11.0) Use lateststatic VersionLUCENE_9_11_0Deprecated.(9.12.0) Use lateststatic VersionLUCENE_9_11_1Deprecated.Use lateststatic VersionLUCENE_9_12_0Deprecated.(9.12.1) Use lateststatic VersionLUCENE_9_12_1Match settings and bugs in Lucene's 9.12.1 release.static VersionLUCENE_9_2_0Deprecated.(9.3.0) Use lateststatic VersionLUCENE_9_3_0Deprecated.(9.4.0) Use lateststatic VersionLUCENE_9_4_0Deprecated.(9.5.0) Use lateststatic VersionLUCENE_9_4_1Deprecated.Use lateststatic VersionLUCENE_9_4_2Deprecated.Use lateststatic VersionLUCENE_9_5_0Deprecated.(9.6.0) Use lateststatic VersionLUCENE_9_6_0Deprecated.(9.7.0) Use lateststatic VersionLUCENE_9_7_0Deprecated.(9.8.0) Use lateststatic VersionLUCENE_9_8_0Deprecated.(9.9.0) Use lateststatic VersionLUCENE_9_9_0Deprecated.(9.9.1) Use lateststatic VersionLUCENE_9_9_1Deprecated.(9.9.2) Use lateststatic VersionLUCENE_9_9_2Deprecated.(9.10.0) Use lateststatic VersionLUCENE_CURRENTDeprecated.UseLATESTintmajorMajor version, the difference between stable and trunkstatic intMIN_SUPPORTED_MAJORConstant for the minimal supported major version of an index.intminorMinor version, incremented within the stable branchintprereleasePrerelease version, currently 0 (alpha), 1 (beta), or 2 (final)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static VersionfromBits(int major, int minor, int bugfix)Returns a new version based on raw numbersstatic StringgetPackageImplementationVersion()Return Lucene's full implementation version.inthashCode()booleanonOrAfter(Version other)Returns true if this version is the same or after the version from the argument.static Versionparse(String version)Parse a version number of the form"major.minor.bugfix.prerelease".static VersionparseLeniently(String version)Parse the given version number as a constant or dot based version.StringtoString()
-
-
-
Field Detail
-
LUCENE_8_0_0
@Deprecated public static final Version LUCENE_8_0_0
Deprecated.(9.0.0) Use latestMatch settings and bugs in Lucene's 8.0.0 release.
-
LUCENE_8_1_0
@Deprecated public static final Version LUCENE_8_1_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.1.0 release.
-
LUCENE_8_1_1
@Deprecated public static final Version LUCENE_8_1_1
Deprecated.Use latestMatch settings and bugs in Lucene's 8.1.1 release.
-
LUCENE_8_2_0
@Deprecated public static final Version LUCENE_8_2_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.2.0 release.
-
LUCENE_8_3_0
@Deprecated public static final Version LUCENE_8_3_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.3.0 release.
-
LUCENE_8_3_1
@Deprecated public static final Version LUCENE_8_3_1
Deprecated.Use latestMatch settings and bugs in Lucene's 8.3.1 release.
-
LUCENE_8_4_0
@Deprecated public static final Version LUCENE_8_4_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.4.0 release.
-
LUCENE_8_4_1
@Deprecated public static final Version LUCENE_8_4_1
Deprecated.Use latestMatch settings and bugs in Lucene's 8.4.1 release.
-
LUCENE_8_5_0
@Deprecated public static final Version LUCENE_8_5_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.5.0 release.
-
LUCENE_8_5_1
@Deprecated public static final Version LUCENE_8_5_1
Deprecated.Use latestMatch settings and bugs in Lucene's 8.5.1 release.
-
LUCENE_8_5_2
@Deprecated public static final Version LUCENE_8_5_2
Deprecated.Use latestMatch settings and bugs in Lucene's 8.5.2 release.
-
LUCENE_8_6_0
@Deprecated public static final Version LUCENE_8_6_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.6.0 release.
-
LUCENE_8_6_1
@Deprecated public static final Version LUCENE_8_6_1
Deprecated.Use latestMatch settings and bugs in Lucene's 8.6.1 release.
-
LUCENE_8_6_2
@Deprecated public static final Version LUCENE_8_6_2
Deprecated.Use latestMatch settings and bugs in Lucene's 8.6.2 release.
-
LUCENE_8_6_3
@Deprecated public static final Version LUCENE_8_6_3
Deprecated.Use latestMatch settings and bugs in Lucene's 8.6.3 release.
-
LUCENE_8_7_0
@Deprecated public static final Version LUCENE_8_7_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.7.0 release.
-
LUCENE_8_8_0
@Deprecated public static final Version LUCENE_8_8_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.8.0 release.
-
LUCENE_8_8_1
@Deprecated public static final Version LUCENE_8_8_1
Deprecated.Use latestMatch settings and bugs in Lucene's 8.8.1 release.
-
LUCENE_8_8_2
@Deprecated public static final Version LUCENE_8_8_2
Deprecated.Use latestMatch settings and bugs in Lucene's 8.8.2 release.
-
LUCENE_8_9_0
@Deprecated public static final Version LUCENE_8_9_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.9.0 release.
-
LUCENE_8_10_0
@Deprecated public static final Version LUCENE_8_10_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.10.0 release.
-
LUCENE_8_10_1
@Deprecated public static final Version LUCENE_8_10_1
Deprecated.Use latestMatch settings and bugs in Lucene's 8.10.1 release.
-
LUCENE_8_11_0
@Deprecated public static final Version LUCENE_8_11_0
Deprecated.(8.11.1) Use latestMatch settings and bugs in Lucene's 8.11.0 release.
-
LUCENE_8_11_1
@Deprecated public static final Version LUCENE_8_11_1
Deprecated.Use latestMatch settings and bugs in Lucene's 8.11.1 release.
-
LUCENE_8_11_2
@Deprecated public static final Version LUCENE_8_11_2
Deprecated.Use latestMatch settings and bugs in Lucene's 8.11.2 release.
-
LUCENE_8_11_3
@Deprecated public static final Version LUCENE_8_11_3
Deprecated.Use latestMatch settings and bugs in Lucene's 8.11.3 release.
-
LUCENE_8_11_4
@Deprecated public static final Version LUCENE_8_11_4
Deprecated.Use latestMatch settings and bugs in Lucene's 8.11.4 release.
-
LUCENE_8_12_0
@Deprecated public static final Version LUCENE_8_12_0
Deprecated.Use latestMatch settings and bugs in Lucene's 8.12.0 release.
-
LUCENE_9_0_0
@Deprecated public static final Version LUCENE_9_0_0
Deprecated.(9.1.0) Use latest
-
LUCENE_9_1_0
@Deprecated public static final Version LUCENE_9_1_0
Deprecated.(9.2.0) Use latest
-
LUCENE_9_2_0
@Deprecated public static final Version LUCENE_9_2_0
Deprecated.(9.3.0) Use latest
-
LUCENE_9_3_0
@Deprecated public static final Version LUCENE_9_3_0
Deprecated.(9.4.0) Use latest
-
LUCENE_9_4_0
@Deprecated public static final Version LUCENE_9_4_0
Deprecated.(9.5.0) Use latest
-
LUCENE_9_4_1
@Deprecated public static final Version LUCENE_9_4_1
Deprecated.Use latestMatch settings and bugs in Lucene's 9.4.1 release.
-
LUCENE_9_4_2
@Deprecated public static final Version LUCENE_9_4_2
Deprecated.Use latestMatch settings and bugs in Lucene's 9.4.2 release.
-
LUCENE_9_5_0
@Deprecated public static final Version LUCENE_9_5_0
Deprecated.(9.6.0) Use latest
-
LUCENE_9_6_0
@Deprecated public static final Version LUCENE_9_6_0
Deprecated.(9.7.0) Use latest
-
LUCENE_9_7_0
@Deprecated public static final Version LUCENE_9_7_0
Deprecated.(9.8.0) Use latest
-
LUCENE_9_8_0
@Deprecated public static final Version LUCENE_9_8_0
Deprecated.(9.9.0) Use latest
-
LUCENE_9_9_0
@Deprecated public static final Version LUCENE_9_9_0
Deprecated.(9.9.1) Use latest
-
LUCENE_9_9_1
@Deprecated public static final Version LUCENE_9_9_1
Deprecated.(9.9.2) Use latestMatch settings and bugs in Lucene's 9.9.1 release.
-
LUCENE_9_9_2
@Deprecated public static final Version LUCENE_9_9_2
Deprecated.(9.10.0) Use latestMatch settings and bugs in Lucene's 9.9.2 release.
-
LUCENE_9_10_0
@Deprecated public static final Version LUCENE_9_10_0
Deprecated.(9.11.0) Use latest
-
LUCENE_9_11_0
@Deprecated public static final Version LUCENE_9_11_0
Deprecated.(9.12.0) Use latest
-
LUCENE_9_11_1
@Deprecated public static final Version LUCENE_9_11_1
Deprecated.Use latestMatch settings and bugs in Lucene's 9.11.1 release.
-
LUCENE_9_12_0
@Deprecated public static final Version LUCENE_9_12_0
Deprecated.(9.12.1) Use latest
-
LUCENE_9_12_1
public static final Version LUCENE_9_12_1
Match settings and bugs in Lucene's 9.12.1 release.Use this to get the latest & greatest settings, bug fixes, etc, for Lucene.
-
LATEST
public static final Version LATEST
WARNING: if you use this setting, and then upgrade to a newer release of Lucene, sizable changes may happen. If backwards compatibility is important then you should instead explicitly specify an actual version.If you use this constant then you may need to re-index all of your documents when upgrading Lucene, as the way text is indexed may have changed. Additionally, you may need to re-test your entire application to ensure it behaves as expected, as some defaults may have changed and may break functionality in your application.
-
LUCENE_CURRENT
@Deprecated public static final Version LUCENE_CURRENT
Deprecated.UseLATESTConstant for backwards compatibility.
-
MIN_SUPPORTED_MAJOR
public static final int MIN_SUPPORTED_MAJOR
Constant for the minimal supported major version of an index. This version is defined by the version that initially created the index.
-
major
public final int major
Major version, the difference between stable and trunk
-
minor
public final int minor
Minor version, incremented within the stable branch
-
bugfix
public final int bugfix
Bugfix number, incremented on release branches
-
prerelease
public final int prerelease
Prerelease version, currently 0 (alpha), 1 (beta), or 2 (final)
-
-
Method Detail
-
parse
public static Version parse(String version) throws ParseException
Parse a version number of the form"major.minor.bugfix.prerelease".Part
".bugfix"and part".prerelease"are optional. Note that this is forwards compatible: the parsed version does not have to exist as a constant.- Throws:
ParseException- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
parseLeniently
public static Version parseLeniently(String version) throws ParseException
Parse the given version number as a constant or dot based version.This method allows to use
"LUCENE_X_Y"constant names, or version numbers in the format"x.y.z".- Throws:
ParseException- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
fromBits
public static Version fromBits(int major, int minor, int bugfix)
Returns a new version based on raw numbers- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
onOrAfter
public boolean onOrAfter(Version other)
Returns true if this version is the same or after the version from the argument.
-
getPackageImplementationVersion
public static String getPackageImplementationVersion()
Return Lucene's full implementation version. This version is saved in Lucene's metadata at build time (JAR manifest, module info). If it is not available, anunknownimplementation version is returned.- Returns:
- Lucene implementation version string, never
null.
-
-