-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[Analysis] Deprecate Standard Html Strip Analyzer in master #26719
Conversation
This concerns me as a breaking change that we should not make in a minor release? I think we can only deprecate in 6.x but not break until 7.0.0. |
@jasontedor You are right. I will change it for onlt deprecation logging. |
Is it needed in 7.x to support indices created in 6.x with the analyzer? If this is correct, I think we have to wait until 8.0.0 to remove? |
7a49f86
to
1364d3f
Compare
cc @elastic/es-search-aggs |
@johtani @romseygeek Is this still something that needs to be done? If so what should we do to get this merged? |
We should still do this, I think. @johtani do you have time to take this up? |
@colings86 @romseygeek Oh, sorry. Yes, I have. I will update this week. |
1364d3f
to
af9ccc5
Compare
@romseygeek I've updated this. Could you review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @johtani. I left some comments.
@@ -1,8 +1,5 @@ | |||
[[breaking-changes-6.1]] | |||
== Breaking changes in 6.1 | |||
++++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is left over from a previous version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch...
if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_6_5_0)) { | ||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("standard_html_strip_deprecation", | ||
"Deprecated analyzer [standard_html_strip] used, " + | ||
"replaced by using [html_strip] char_filter"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/replaced/replace/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably also be explicit that you need to replace it with a custom analyzer using standard
tokenizer and html_strip
char_filter, plus lowercase
filter and any other filters you have been using.
/** | ||
* Check that the deprecated analyzer name "standard_html_strip" issues a deprecation warning for indices created before 6.4.0 | ||
*/ | ||
public void testStandardHtmlStripAnalyzerNoDeprecationPre6_5() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test doesn't seem to do what the comment suggests it should do? I think it can be repurposed to check that an exception is thrown if you try to create an analyzer of type standard_html_strip
with an index created version greater than or equal to 7.0, and the test above can just check that the warning is emitted on any version before 7.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch. I forgot add "does NOT" after copy & paste...
I'm not sure your comment about 7.0. Is your comment about PR for master branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I hadn't noticed that this was against 6.x. Do you have a separate PR against master? I think it makes most sense to do this against master and then backport?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I made this PR for logging deprecation and I thought we removeed this analyzer in 7 at that time.
I agree to do against master first. I will change this PR to against 7. sorry
} else if ("standard_html_strip".equals(analyzer)) { | ||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("standard_html_strip_deprecation", | ||
"Deprecated analyzer [standard_html_strip] used, " + | ||
"replaced by using [html_strip] char_filter"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/replaced/replace/
==== Deprecated standard_html_strip analyzer | ||
|
||
Deprecated standard_html_strip analyser in 6.5. | ||
This will be not create in 7.0 and be removed in 8.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
The standard_html_strip
analyzer has been deprecated, and should be replaced with a combination of the standard
tokenizer and html_strip
char_filter. Indexes created using this analyzer will still be readable in elasticsearch 7.0, but it will not be possible to create new indexes using it.
d6bf840
to
613c6de
Compare
fe0ed0c
to
76a42c5
Compare
@romseygeek Change this to against master branch. Please review again if you have time :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple more comments.
"use a custom analyzer using [standard] tokenizer and [html_strip] char_filter, plus [lowercase] filter"); | ||
} catch (Exception e) { | ||
fail("expected IAE"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use expectThrows
here?
...ommon/src/main/java/org/elasticsearch/analysis/common/StandardHtmlStripAnalyzerProvider.java
Show resolved
Hide resolved
@romseygeek Thanks for you comments. Fix these. Your 2nd comment means that we should issue deprecation log for any index created with 6.x, right? I have a question about test. How do we test 6.6.1 <= versions < 7.0.0_alpha1 with VersionUtils.randomVersionBetween(...) ? |
You can use LGTM otherwise. Thanks! |
retest this please |
2175c32
to
b2bbf27
Compare
@elasticmachine test this please |
Deprecate only Standard Html Strip Analyzer If user create index with the analyzer since 7.0, es throws an exception. If an index was created before 7.0, es issue deprecation log We will remove it in 8.0 Related elastic#4704
Use expectThrows Change versions for deprecation log Related elastic#4704
Fix checkstyle error Related elastic#4704
Change to use getPreviousVersion Related elastic#4704
1531b72
to
af6c151
Compare
Change version to 7_0_0 and fix deprecationlogger error Related elastic#4704
af6c151
to
51bdace
Compare
Backport elastic#26719 to 6.x Closes elastic#4704 (cherry picked from commit 38b698d)
Backport elastic#26719 to 6.x Closes elastic#4704 (cherry picked from commit 38b698d)
Backport elastic#26719 to 6.x Closes elastic#4704 (cherry picked from commit 38b698d)
Backport elastic#26719 to 6.x Closes elastic#4704 (cherry picked from commit 38b698d)
Deprecate standard_html_strip analyzer in 6.x
I will make PR for removing the analyzer on master
Closes #4704