BUG: Fixes #573. Changed segment names to match Lucene 4.8.0 and Lucene.NET 3.x #576
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #573. This is a breaking change. The segment file names were being generated in base 10 rather than base 36 (Character.MaxRadix), which caused us to generate different segment file names than Lucene and Lucene.NET 3.x. This changes the base back to 36, but it means 4.8.0-beta00016 and beyond will not be able to read indexes produced by previous betas by default.
To fix this, we added a
SegmentInfos.UseLegacySegmentNames
setting to read 4.8.0-beta00001 thru 4.8.0-beta00015 indexes, which isfalse
by default. Setting totrue
at application startup will enable reading indexes from prior beta versions (with broken segment names).Alternatively, set the system property
"useLegacySegmentNames"
to"true"
. Using the default setup, this can be done by adding an environment variable named"lucene:useLegacySegmentNames"
with a value of"true"
.The
"useLegacySegmentNames"
setting can be injected by supplying a customLucene.Net.Configuration.IConfigurationFactory
usingLucene.Net.Configuration.ConfigurationSettings.SetConfigurationFactory(Configuration.IConfigurationFactory)
. See Configuration Providers in .NET for details about how to configure them. In general there should be 1IConfiguration
per application and it should be passed into the constructor of theIConfigurationFactory
implementation and returned from theIConfigurationFactory.GetConfiguration()
method.See #307 for more information about system properties.