-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Update UpdateForV9
in AttachmentProcessor
#118186
Changes from 1 commit
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
import org.elasticsearch.common.Strings; | ||
import org.elasticsearch.common.logging.DeprecationCategory; | ||
import org.elasticsearch.common.logging.DeprecationLogger; | ||
import org.elasticsearch.core.UpdateForV9; | ||
import org.elasticsearch.core.UpdateForV10; | ||
import org.elasticsearch.ingest.AbstractProcessor; | ||
import org.elasticsearch.ingest.IngestDocument; | ||
import org.elasticsearch.ingest.Processor; | ||
|
@@ -196,7 +196,7 @@ public IngestDocument execute(IngestDocument ingestDocument) { | |
* @param property property to add | ||
* @param value value to add | ||
*/ | ||
private <T> void addAdditionalField(Map<String, Object> additionalFields, Property property, String value) { | ||
private void addAdditionalField(Map<String, Object> additionalFields, Property property, String value) { | ||
if (properties.contains(property) && Strings.hasLength(value)) { | ||
additionalFields.put(property.toLowerCase(), value); | ||
} | ||
|
@@ -233,16 +233,16 @@ public AttachmentProcessor create( | |
String processorTag, | ||
String description, | ||
Map<String, Object> config | ||
) throws Exception { | ||
) { | ||
String field = readStringProperty(TYPE, processorTag, config, "field"); | ||
String resourceName = readOptionalStringProperty(TYPE, processorTag, config, "resource_name"); | ||
String targetField = readStringProperty(TYPE, processorTag, config, "target_field", "attachment"); | ||
List<String> propertyNames = readOptionalList(TYPE, processorTag, config, "properties"); | ||
int indexedChars = readIntProperty(TYPE, processorTag, config, "indexed_chars", NUMBER_OF_CHARS_INDEXED); | ||
boolean ignoreMissing = readBooleanProperty(TYPE, processorTag, config, "ignore_missing", false); | ||
String indexedCharsField = readOptionalStringProperty(TYPE, processorTag, config, "indexed_chars_field"); | ||
@UpdateForV9(owner = UpdateForV9.Owner.DATA_MANAGEMENT) | ||
// update the [remove_binary] default to be 'true' assuming enough time has passed. Deprecated in September 2022. | ||
@UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT) | ||
// Revisit whether we want to update the [remove_binary] default to be 'true' - would need to find a way to do this safely | ||
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. N.B. I'm not currently changing the deprecation message (which says that the property "will be set to 'true' in a future release", when actually we're not committed to that) because we don't know for sure what we're going to do in V10 and it seems better to (a) stay with the status quo, and (b) err on the side of making an overly-strong warning. I'm open to suggestions for rewording, though. |
||
Boolean removeBinary = readOptionalBooleanProperty(TYPE, processorTag, config, "remove_binary"); | ||
if (removeBinary == null) { | ||
DEPRECATION_LOGGER.warn( | ||
|
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 wasn't sure of the best way to convey this state of affairs... Alternative suggestions welcome!