Skip to content

Conversation

@mayya-sharipova
Copy link
Contributor

  • Introduce index level setting "index.highlight.max_analyzed_offset"
    to control the max number of character to be analyzed for highlighting
  • Make this setting to be unset by default (equal to -1)
  • Issue a deprecation warning if setting is unset and analysis is required
    on a text larger than ES v 7.x max setting (10000)
  • Throw IllegalArgumentException is setting is set by a user, and
    analysis is required on a text larger than the user's set value.

Closes #27517

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mayya-sharipova , I left some comments

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change coming from another pr ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jimczi this is a typo noticed by someone else, I thought I would include this correction here as well. Let me know if I should not do that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a pr open for this typo so we should use it rather than adding this in a pr that targets 6.x only.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have a custom validator to throw an exception when the value is set to 0. Otherwise this would fail the upgrade to 7 where 0 is forbidden.

@mayya-sharipova mayya-sharipova force-pushed the limit-analyzed-text-for-highlight2 branch from bf58c2e to 47c59a5 Compare January 11, 2018 17:24
- Introduce index level setting "index.highlight.max_analyzed_offset"
to control the max number of character to be analyzed for highlighting
- Make this setting to be unset by default (equal to -1)
- Issue a deprecation warning if setting is unset and analysis is required
 on a text larger than ES v.7.x max setting (10000)
- Throw IllegalArgumentException is setting is set by a user, and
analysis is required on a text larger than the user's set value.

Closes elastic#27517

Adding validator for index.highlight.max_analyzed_offset setting
@mayya-sharipova mayya-sharipova force-pushed the limit-analyzed-text-for-highlight2 branch from 47c59a5 to 2e9f31e Compare January 12, 2018 12:44
throw new IllegalArgumentException(
"[" + MAX_ANALYZED_OFFSET_SETTING.getKey() + "] must be >= 1");
}
this.maxAnalyzedOffset = maxAnalyzedOffset;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jimczi I have added a custom validator here, as you suggested. This should guard against setting value <1. Can you please continue the reviewing when you have available time.

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mayya-sharipova mayya-sharipova merged commit b43dd6d into elastic:6.x Jan 15, 2018
@mayya-sharipova mayya-sharipova deleted the limit-analyzed-text-for-highlight2 branch January 15, 2018 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants