-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Remove 'external values', and replace with swapped out XContentParsers #72203
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
Changes from 2 commits
d8bad73
c109d67
5b60b73
44ef7a5
afa0f20
ff52018
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -596,6 +596,12 @@ public ContentPath path() { | |
}; | ||
} | ||
|
||
/** | ||
* We are actively deprecating and removing the ability to pass complex objects | ||
* to multifields - try and avoid using this method | ||
* @deprecated | ||
*/ | ||
@Deprecated | ||
public final ParseContext switchParser(XContentParser parser) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should mark this as deprecated, with a note we are actively deprecating + removing usages of it. That will prevent us from adding more usages accidentally. If there are any plugin authors using external values (which I hope there aren't), this will discourage them from just switching onto this method, which we hope to eventually remove. |
||
return new FilterParseContext(this) { | ||
@Override | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -306,6 +306,8 @@ public void testCompletionWithContextAndSubCompletion() throws Exception { | |
contextSuggestField("timmy"), | ||
contextSuggestField("starbucks") | ||
)); | ||
// check that the indexable fields produce tokenstreams without throwing an exception | ||
// if this breaks it is likely a problem with setting contexts | ||
try (TokenStream ts = indexableFields.getFields("field.subsuggest")[0].tokenStream(Lucene.WHITESPACE_ANALYZER, null)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain what this tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my initial implementation contexts weren't getting transferred correctly to subfields, and iterating over the field tokenstream would throw an exception. This was picked up by rest tests, but we didn't have a unit test for it. As it's not easy to check that the field has been correctly built via introspection, I used this as a way to trigger the bug in a unit test so I could track it down more easily. I'll add a comment, I think it's probably worth keeping here just because it fails faster than a rest test. |
||
ts.reset(); | ||
while (ts.incrementToken()) {} | ||
|
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.
Small comment, I think we usually style it like
@deprecated <explanation text>