Skip to content
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

Convert Processor enhancement (description, snippet) #35280

Merged
merged 2 commits into from
Nov 7, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions docs/reference/ingest/ingest-node.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ include::ingest-node-common-processor.asciidoc[]

[[convert-processor]]
=== Convert Processor
Converts an existing field's value to a different type, such as converting a string to an integer.
Converts a source field's value which is not ingested yet to a different type, such as converting a string to an integer.
insukcho marked this conversation as resolved.
Show resolved Hide resolved
If the field value is an array, all members will be converted.

The supported types include: `integer`, `long`, `float`, `double`, `string`, `boolean`, and `auto`.
Expand Down Expand Up @@ -857,11 +857,17 @@ include::ingest-node-common-processor.asciidoc[]

[source,js]
--------------------------------------------------
PUT _ingest/pipeline/studentindex
insukcho marked this conversation as resolved.
Show resolved Hide resolved
{
"convert": {
"field" : "url.port",
"type": "integer"
}
"description": "for student index converting from string id field to integer one ",
Copy link
Member

Choose a reason for hiding this comment

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

Again, this raises the question where or what the student index is. I would keep it more general. What do you think is missing or ambigouous from the previous example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, how about describe pipeline for more general purpose?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe you could decribe what the processor does. In this case it "converts the content of the id field to an integer". By callind the field e.g. "id_string" you could also make it clearer that the original field is suppoesd to not be an integer but a string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree w/ describe more clear description like converts the content of the id field to an integer. But for using "id_string" maybe not a good idea because it was string, but it will be changed to integer after ingestion. So, it can make more confusion.

"processors" : [
{
"convert" : {
"field" : "id",
"type": "integer"
}
}
]
}
--------------------------------------------------
// NOTCONSOLE
Expand Down