Skip to content

max_analyzed_offset can not Limited OffsetSource.POSTINGS #86109

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

Closed
luyuncheng opened this issue Apr 24, 2022 · 1 comment
Closed

max_analyzed_offset can not Limited OffsetSource.POSTINGS #86109

luyuncheng opened this issue Apr 24, 2022 · 1 comment
Labels
>enhancement :Search Relevance/Highlighting How a query matched a document Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch

Comments

@luyuncheng
Copy link
Contributor

luyuncheng commented Apr 24, 2022

Description

In #67325 add max_analyzed_offset allows users to limit the highlighting of text fields.
but when using "index_options": "offsets" in mappings, this max_analyzed_offset offset limit can not be limited, because it would use OffsetSource.ANALYSIS and PostingsOffsetStrategy to highlight field.

Some tests can simply explain: link

When a string="Testing Fun Testing Fun" need to be highlight

Using UnifiedHighlighter.OffsetSource.ANALYSIS with queryMaxAnalyzedOffset=10 would response:

"Testing <b>Fun</b> Testing Fun"

because in #67325 add LimitTokenOffsetAnalyzer

BUT USING UnifiedHighlighter.OffsetSource.POSTINGS which index_options=offsets with queryMaxAnalyzedOffset=10 would response:

"Testing <b>Fun</b> Testing <b>Fun</b>"

because offset can not be limited by LimitTokenOffsetAnalyzer

Proposal

may be can add a new LimitedOffsetsEnum to limit this

Link PR: #86110

@luyuncheng luyuncheng added >enhancement needs:triage Requires assignment of a team area label labels Apr 24, 2022
@cbuescher cbuescher added :Search Relevance/Highlighting How a query matched a document and removed needs:triage Requires assignment of a team area label labels Apr 25, 2022
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Apr 25, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@javanna javanna added Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch and removed Team:Search Meta label for search team labels Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search Relevance/Highlighting How a query matched a document Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

4 participants