Skip to content

v4.8.0-beta00010

Pre-release
Pre-release
Compare
Choose a tag to compare
@NightOwl888 NightOwl888 released this 19 Jul 08:57
· 1293 commits to master since this release

This release contains impactful performance enhancements.

Known Issues

  • The lucene-cli tool requires an appsettings.json file, but none was shipped. Upon running lucene on the command line, the following error will be presented:

    F:\Projects\lucenenet>lucene
    Unhandled exception. System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional. The         physical path is 'C:\Users\shad\.dotnet\tools\.store\lucene-cli\4.8.0-beta00010\lucene-cli\4.8.0-beta00010\tools\netcoreapp3.1\any\appsettings.json'.
    at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
    at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
    at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
    at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
    at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
    at Lucene.Net.Cli.Program.Main(String[] args) in D:\a\1\s\src\dotnet\tools\lucene-cli\Program.cs:line 27
    

    Adding a text file named appsettings.json to the location specified in the error message with opening and closing brackets will prevent the exception.

    appsettings.json

    {
    }
    

    IMPORTANT: There must be at least opening and closing curly brackets in the file, or it won't be parsed as valid JSON.

  • J2N versions prior to version 2.0.0-beta-0012 had an infinite recursion bug on Xamarin.Android which caused fatal crashes in Lucene.NET. Upgrading J2N to 2.0.0-beta-0012 or higher will prevent these crashes from occurring.

Change Log

Breaking Changes

  • PERFORMANCE: Lucene.Net.Suggest: Narrowed return type of Contexts property from IEnumerable<BytesRef> to ICollection<BytesRef> to improve performance for certain operations
  • Lucene.Net.TestFramework.Util.LuceneTestCase: Refactored to correctly load static fields and converted them into static properties. The names were changed to match the conventions of .NET properties.
  • #261 PERFORMANCE: Changed to use BitSet instead of BitArray so we don't have to resort to slow extension methods for certain operations

Bugs

  • Lucene.Net.Support.Collections::ToString(): Fixed overloads to write "null" when the collection passed is null rather than throw an exception
  • #267 - Lucene.Net.Codecs: Fixed testing condition for BaseTermVectorsFormatTestCase on TermVectorsReaders by throwing InvalidOperationException
  • #301 - After upgrading NuGet package dependencies for NUnit to 3.12.0, NUnit3TestAdapter to 3.16.1, and Microsoft.NET.Test.Sdk to 16.6.1, several false positives were noted due to invalid try-catch logic in tests

Improvements

  • Added missing documentation table of contents links for lucene-cli, Lucene.Net.Demo, Lucene.Net.Queries, Lucene.Net.QueryParser, Lucene.Net.Replicator, Lucene.Net.Sandbox, Lucene.Net.Spatial, and Lucene.Net.Suggest.
  • #261 PERFORMANCE: - Removed all calls to Type.GetTypeInfo() and call properties/methods on the Type instance directly.
  • #261 PERFORMANCE: - Lucene.Net.Util.AttributeSource: Create built-in attributes directly rather than using Activator.CreateInstance()
  • #261 PERFORMANCE: - Lucene.Net.Util.AttributeSource: Optimized creation of string to identify attribute type based on attribute interface name
  • #295 PERFORMANCE: - Lucene.Net.TestFramework: Added overloads of Assert.AreEqual for collections where J2N's aggressive mode can be switched off
  • #295 PERFORMANCE: - Lucene.Net.TestFramework: Replaced overloads from NUnit.Framework.CollectionAssert with optimized implementations using J2N comparers
  • #295 PERFORMANCE: - Lucene.Net.TestFramework: Compile expensive string concatenation out of the release build by using System.Diagnostics.Debug.Assert
  • #295 PERFORMANCE: - Lucene.Net.Util.Automaton: Fixed State class to initialize and trim more efficiently.
    Fixes the performance of Lucene.Net.Util.Automaton.TestBasicOperations::TestEmptyLanguageConcatenate().
  • #295, #261: PERFORMANCE: - Reduced zero length array allocations
  • #295, #261: PERFORMANCE: - Reduced zero length collection allocations
  • #295, #261: PERFORMANCE: - Lucene.Net.TestFramework.Search.RandomSimilarityProvider::ToString(): Use StringBuilder for better efficiency
  • #295, #261: PERFORMANCE: - Lucene.Net.TestFramework.Util.LuceneTestCase: Cache codecType and similarityName as strings so they don't have to be regenerated for each test
  • #295, #261: PERFORMANCE: - Lucene.Net.TestFramework: Use Assert.IsFalse() rather than Assert.That()
  • #295, #261: PERFORMANCE: - Reduced calls to LINQ methods and expressions.
  • #295, #261: PERFORMANCE: - Lucene.Net.Index.Term: Optimized equality checking
  • #295, #261: PERFORMANCE: - Lucene.Net.Util (BytesRef + CharsRef): Implemented IEquatable<T>
  • #295, #261: PERFORMANCE: - Lucene.Net.Tests.Index.TestDocumentsWriterDeleteQueue: Updated comparisons to reduce memory allocations
  • #295, #261: PERFORMANCE: - Lucene.Net.TestFramework: Changed ConcurrentMergeSchedulerFactories.Values to only return the TaskMergeScheduler rarely, since it is no longer a default setting and is slowing down tests
  • #295, #261: PERFORMANCE: - Added some aggressive inlining
  • Lucene.Net.TestFramework: Added overloads of Assert.Throws to supply messages
  • Lucene.Net.TestFramework: Use the Microsoft.Extensions.Configuration.EnvironmentVariables provider instead of our custom one.
  • Lucene.Net.Analysis.Tokenizer: Allow enabling "asserts" for testing
  • azure-pipelines.yml: Changed to use pipeline caching instead of build caching for better performance
  • Lucene.Net.Tests (core) - Rearranged how test projects are split so parallel jobs can process them faster
  • Fixed up leading whitespace to always use spaces instead of tabs
  • Updated NuGet package dependency for J2N to 2.0.0-beta-0008
  • Lucene.Net.Tests.Analysis.Phonetic.Language.Bm.PhoneticEnginePeformanceTest::Test(): Changed to use Stopwatch for more accurate timing
  • Lucene.Net.Tests: Changed private/internal member variables to consistently use camelCase instead of PascalCase
  • SWEEP: Changed all properties to use expression style syntax, reordered to put get before set, and changed all backing field names back to their original without the "_Renamed" suffix
  • SWEEP: Removed fully-qualified exceptions and added using directives instead
  • PERFORMANCE: Pre-compile and statically cache regular expressions
  • PERFORMANCE: Lucene.Net.Analysis: Removed unnecessary allocations caused by calling ToString() rather than passing the ICharTermAttribute directly
  • PERFORMANCE: Lucene.Net.Analysis.Common: Slight optimization of ToUpper and ToLower methods, which are used in several analyzers
  • SWEEP: Removed .NET Standard 1.x/.NET Core 1.x support from all project files
  • SWEEP: Removed unused dependencies for .NET Framework
  • PERFORMANCE: Lucene.Net.Codecs.SimpleText: Using decimal is 30% faster than using BigInteger for addition and subtraction
  • PERFORMANCE: Applied Slow and Nightly attributes where applicable for better testing performance
  • Lucene.Net.TestFramework: Added logging of system properties to the output of tests
  • PERFORMANCE: Lucene.Net.Util.ArrayUtil::GetNaturalComparer<T>(): Use statically cached singleton instance of comparer
  • Upgraded NuGet dependency ICU4N to 60.1.0-alpha.351

New Features

  • Lucene.Net.TestFramework.RandomExtensions: Added missing overload of NextInt64(long) to choose only max upper bound
  • Added a global Lucene.Net.Diagnostics.Debugging.AssertsEnabled static property that can be used to toggle "asserts" on and off in the release build, similar to how it works in Java. The setting can be injected by end users with the "assert" system property (which is a boolean).
  • Lucene.Net.TestFramework: Completed implementation of Nightly, Weekly, AwaitsFix and Slow attributes