You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2021/12/13 11:42:29 UTC

[GitHub] [lucenenet] NightOwl888 opened a new pull request #576: BUG: Fixes #573. Changed segment names to match Lucene 4.8.0 and Lucene.NET 3.x

NightOwl888 opened a new pull request #576:
URL: https://github.com/apache/lucenenet/pull/576


   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 is `false` by default. Setting to `true` at application startup will enable reading indexes from prior beta versions (with broken segment names).
   
   > NOTE: We recommend regenerating your indexes, if possible, rather than using this "feature". Enabling this makes the file names inconsistent. Some methods were generating or parsing in the correct base/radix, but others were not. This restores the state to exactly how it was in 4.8.0-beta00015, but do note the inconsistency likely means that certain indexes with more than 10 segments will fail under certain use cases.
   
   ```c#
   SegmentInfos.UseLegacySegmentNames = true;
   ```
   
   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 custom `Lucene.Net.Configuration.IConfigurationFactory` using `Lucene.Net.Configuration.ConfigurationSettings.SetConfigurationFactory(Configuration.IConfigurationFactory)`. See [Configuration Providers in .NET](https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration-providers) for details about how to configure them. In general there should be 1 `IConfiguration` per application and it should be passed into the constructor of the `IConfigurationFactory` implementation and returned from the `IConfigurationFactory.GetConfiguration()` method.
   
   See #307 for more information about system properties.
   
   > NOTE: The prefix "lucene:" only applies to environment variable names, all other system property names should exclude this prefix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 merged pull request #576: BUG: Fixes #573. Changed segment names to match Lucene 4.8.0 and Lucene.NET 3.x

Posted by GitBox <gi...@apache.org>.
NightOwl888 merged pull request #576:
URL: https://github.com/apache/lucenenet/pull/576


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org