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

Fixes #321: fix highlight max_analyzer_offset field name to match OS 2.2.0 #322

Merged
merged 4 commits into from
Aug 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixes #321: fix highlight max_analyzer_offset field name to match OS …
…2.2.0

Signed-off-by: Gideon Junge <gjunge@gmail.com>
  • Loading branch information
gjunge committed Aug 19, 2023
commit a7609127326ff319b35fc545c2fc3718a418d7f2
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Moved `OpenSearch.Client` request classes into their respective namespaces to match those in `OpenSearch.Net` ([#200](https://github.com/opensearch-project/opensearch-net/pull/200), [#202](https://github.com/opensearch-project/opensearch-net/pull/202), [#203](https://github.com/opensearch-project/opensearch-net/pull/203), [#205](https://github.com/opensearch-project/opensearch-net/pull/205), [#206](https://github.com/opensearch-project/opensearch-net/pull/206), [#207](https://github.com/opensearch-project/opensearch-net/pull/207), [#208](https://github.com/opensearch-project/opensearch-net/pull/208), [#209](https://github.com/opensearch-project/opensearch-net/pull/209))
- Removed support for the `net461` target ([#256](https://github.com/opensearch-project/opensearch-net/pull/256))

### Fixed
- Fix highlight max_analyzer_offset field name to match with the one introduced in OpenSearch 2.2.0 ([#322](https://github.com/opensearch-project/opensearch-net/pull/322))

### Dependencies
- Bumps `Microsoft.CodeAnalysis.CSharp` from 4.2.0 to 4.6.0
- Bumps `Microsoft.TestPlatform.ObjectModel` from 17.5.0 to 17.6.3
@@ -88,4 +91,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

[Unreleased]: https://github.com/opensearch-project/opensearch-net/compare/v1.4.0...main
[1.4.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0
[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0
12 changes: 6 additions & 6 deletions src/OpenSearch.Client/Search/Search/Highlighting/Highlight.cs
Original file line number Diff line number Diff line change
@@ -107,8 +107,8 @@ public interface IHighlight
/// If this setting is set to a non-negative value, the highlighting stops at this defined maximum limit, and the
/// rest of the text is not processed, thus not highlighted and no error is returned.
/// </summary>
[DataMember(Name ="max_analyzed_offset")]
int? MaxAnalyzedOffset { get; set; }
[DataMember(Name ="max_analyzer_offset")]
int? MaxAnalyzerOffset { get; set; }

[DataMember(Name ="max_fragment_length")]
int? MaxFragmentLength { get; set; }
@@ -210,7 +210,7 @@ public class Highlight : IHighlight
public QueryContainer HighlightQuery { get; set; }

/// <inheritdoc/>
public int? MaxAnalyzedOffset { get; set; }
public int? MaxAnalyzerOffset { get; set; }

/// <inheritdoc/>
public int? MaxFragmentLength { get; set; }
@@ -258,7 +258,7 @@ public class HighlightDescriptor<T> : DescriptorBase<HighlightDescriptor<T>, IHi
int? IHighlight.FragmentOffset { get; set; }
int? IHighlight.FragmentSize { get; set; }
QueryContainer IHighlight.HighlightQuery { get; set; }
int? IHighlight.MaxAnalyzedOffset { get; set; }
int? IHighlight.MaxAnalyzerOffset { get; set; }
int? IHighlight.MaxFragmentLength { get; set; }
int? IHighlight.NoMatchSize { get; set; }
int? IHighlight.NumberOfFragments { get; set; }
@@ -323,8 +323,8 @@ public HighlightDescriptor<T> HighlightQuery(Func<QueryContainerDescriptor<T>, Q
/// <inheritdoc cref="IHighlight.BoundaryMaxScan" />
public HighlightDescriptor<T> BoundaryMaxScan(int? boundaryMaxScan) => Assign(boundaryMaxScan, (a, v) => a.BoundaryMaxScan = v);

/// <inheritdoc cref="IHighlight.MaxAnalyzedOffset" />
public HighlightDescriptor<T> MaxAnalyzedOffset(int? maxAnalyzedOffset) => Assign(maxAnalyzedOffset, (a, v) => a.MaxAnalyzedOffset = v);
/// <inheritdoc cref="IHighlight.MaxAnalyzerOffset" />
public HighlightDescriptor<T> MaxAnalyzerOffset(int? maxAnalyzerOffset) => Assign(maxAnalyzerOffset, (a, v) => a.MaxAnalyzerOffset = v);

/// <inheritdoc cref="IHighlight.MaxFragmentLength" />
public HighlightDescriptor<T> MaxFragmentLength(int? maxFragmentLength) => Assign(maxFragmentLength, (a, v) => a.MaxFragmentLength = v);