Skip to content

Commit

Permalink
Fixes #321: fix highlight max_analyzer_offset field name to match OS …
Browse files Browse the repository at this point in the history
…2.2.0

Signed-off-by: Gideon Junge <gjunge@gmail.com>
  • Loading branch information
gjunge committed Aug 17, 2023
1 parent 74bcaab commit d998073
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Up @@ -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; }
Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d998073

Please sign in to comment.