Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING: Lucene.Net.Documents.DateTools/Lucene.Net.QueryParser Updates #580

Merged

Conversation

NightOwl888
Copy link
Contributor

@NightOwl888 NightOwl888 commented Dec 19, 2021

DateTools

  • Added support for TimeZoneInfo when converting to/from string
  • BREAKING: Added NumericRepresentation enum to allow converting to/from long in the following formats:
    • Unix Epoch (default): Milliseconds since Jan 1, 1970 12:00:00 AM UTC.
    • Ticks: The raw ticks from DateTime or DateTimeOffset.
    • Ticks as Milliseconds: This is for compatibility with prior versions of Lucene.NET (3.0.3 and 4.8.0-beta00001 - 4.8.0-beta00015). The conversion done on input values is time * TimeSpan.TicksPerMillisecond and the conversion to output values is time / TimeSpan.TicksPerMillisecond.
  • BREAKING: De-nested Resolution enum and renamed DateResolution.

QueryParser

  • Lucene.Net.QueryParsers.Flexible.Standard.Config.NumberDateFormat: Added constructor overload to format a date without a time.
  • Lucene.Net.QueryParsers.Flexible.Standard.Config.NumberDateFormat: Added NumericRepresentation property to set the representation to use for both Format() and Parse().
  • Added support for TimeZoneInfo when converting to/from string (Classic and Flexible query parsers)
  • BREAKING: Lucene.Net.QueryParsers.Flexible.Standard: Changed numeric nodes to accept and return J2N.Numerics types instead of object.
  • Lucene.Net.QueryParsers.Classic.QueryParserBase: Use TryParse() instead of Parse() to parse numeric values. Use the current culture, but fall back to invariant culture.

…n function and used built-in string formatting to eliminate lots of if-else statements
…to specify how the input and output number should be treated when making conversions. De-nested Resolution and enum and renamed DateResolution.
…ded constructor overload to specify date without time (similar to DateFormat.getDateFormat() in Java)
…ded support for converting to/from ticks or ticks as milliseconds.
…use J2N.Numerics types instead of value types to avoid boxing/unboxing
…gle.TryParse() instead of float.Parse() to eliminate exceptions. Use current culture and fallback on invariant culture for Java compatibility.
@NightOwl888 NightOwl888 added this to the 4.8.0-beta00016 milestone Dec 20, 2021
@NightOwl888 NightOwl888 merged commit 46e2437 into apache:master Dec 20, 2021
@NightOwl888 NightOwl888 mentioned this pull request Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant