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

[BUG] "Misspelling" on setting MaxAnalyzedOffset on IHighlight #321

Closed
gjunge opened this issue Aug 17, 2023 · 0 comments
Closed

[BUG] "Misspelling" on setting MaxAnalyzedOffset on IHighlight #321

gjunge opened this issue Aug 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@gjunge
Copy link
Contributor

gjunge commented Aug 17, 2023

What is the bug?

Same bug as opensearch-project/opensearch-java#553 , since this part was copied from the ES clients. ES implemented this field as max_analyzed_offset (see ES docs), while OpenSearch implemented the field as max_analyzer_offset in 2.2.0 (see OS docs)

As can be seen in the Java client bug description, using this field will lead to this error

    "error": {
        "root_cause": [
            {
                "type": "x_content_parse_exception",
                "reason": "[36:9] [highlight] unknown field [max_analyzed_offset] did you mean [max_analyzer_offset]?"
            }
        ],
        "type": "x_content_parse_exception",
        "reason": "[36:9] [highlight] unknown field [max_analyzed_offset] did you mean [max_analyzer_offset]?"
    },
    "status": 400
}

How can one reproduce the bug?

var results = await _opensearchClient.SearchAsync<MyRecord>(
        sd => sd.TrackTotalHits(true)
                .Query(q => q.MatchAll())
                .Highlight(h =>
                h.PreTags("<mark>")
                    .PostTags("</mark>")
                    .Fields(
                        f => f.Field("title")
                    )
                    .MaxAnalyzedOffset(10000)  //<-- this is the issue.
                )


        );

What is the expected behavior?

Update the api to match the OpenSearch Highlight setting max_analyzer_offset

What is your host/environment?

AWS Managed OpenSearch service 2.7.

@gjunge gjunge added bug Something isn't working untriaged labels Aug 17, 2023
gjunge pushed a commit to gjunge/opensearch-net that referenced this issue Aug 17, 2023
… name to match with the one introduced in OpenSearch 2.2.0

Signed-off-by: Gideon Junge <gjunge@gmail.com>
gjunge added a commit to gjunge/opensearch-net that referenced this issue Aug 17, 2023
… name to match with the one introduced in OpenSearch 2.2.0

Signed-off-by: Gideon Junge<gjunge@gmail.com>
gjunge added a commit to gjunge/opensearch-net that referenced this issue Aug 17, 2023
… name to match OS 2.2.0

Signed-off-by: Gideon Junge <gjunge@gmail.com>
@Xtansia Xtansia removed the untriaged label Aug 18, 2023
gjunge added a commit to gjunge/opensearch-net that referenced this issue Aug 19, 2023
… name to match OS 2.2.0

Signed-off-by: Gideon Junge <gjunge@gmail.com>
Xtansia pushed a commit to Xtansia/opensearch-net that referenced this issue Aug 20, 2023
… name to match OS 2.2.0 (opensearch-project#322)

* Fixes opensearch-project#321: fix highlight max_analyzer_offset field name to match OS 2.2.0

Signed-off-by: Gideon Junge <gjunge@gmail.com>

* extend existing highlighting unit test

Signed-off-by: Gideon Junge <gjunge@gmail.com>

* Create > 2.2.0 unit test

Signed-off-by: Gideon Junge <gjunge@gmail.com>

* Implement HighlightField level max_analyzer_offset

max_analyzer_offset can be set both on highlight in general, and on specific fields.

Signed-off-by: Gideon Junge <gjunge@gmail.com>

---------

Signed-off-by: Gideon Junge <gjunge@gmail.com>
(cherry picked from commit 8ad8057)
Xtansia pushed a commit to Xtansia/opensearch-net that referenced this issue Aug 20, 2023
… name to match OS 2.2.0 (opensearch-project#322)

* Fixes opensearch-project#321: fix highlight max_analyzer_offset field name to match OS 2.2.0

Signed-off-by: Gideon Junge <gjunge@gmail.com>

* extend existing highlighting unit test

Signed-off-by: Gideon Junge <gjunge@gmail.com>

* Create > 2.2.0 unit test

Signed-off-by: Gideon Junge <gjunge@gmail.com>

* Implement HighlightField level max_analyzer_offset

max_analyzer_offset can be set both on highlight in general, and on specific fields.

Signed-off-by: Gideon Junge <gjunge@gmail.com>

---------

Signed-off-by: Gideon Junge <gjunge@gmail.com>
(cherry picked from commit 8ad8057)
Xtansia added a commit that referenced this issue Aug 22, 2023
…2.2.0 (#322) (#324)

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

Signed-off-by: Gideon Junge <gjunge@gmail.com>

* extend existing highlighting unit test

Signed-off-by: Gideon Junge <gjunge@gmail.com>

* Create > 2.2.0 unit test

Signed-off-by: Gideon Junge <gjunge@gmail.com>

* Implement HighlightField level max_analyzer_offset

max_analyzer_offset can be set both on highlight in general, and on specific fields.

Signed-off-by: Gideon Junge <gjunge@gmail.com>

---------

Signed-off-by: Gideon Junge <gjunge@gmail.com>
(cherry picked from commit 8ad8057)

Co-authored-by: Gideon Junge <gjunge@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants