-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Add date_index_name processor #17973
Add date_index_name processor #17973
Conversation
import java.util.Map; | ||
import java.util.function.Function; | ||
|
||
public final class DateIndexNameProcessor extends AbstractProcessor { |
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.
There is overlap with what the date
and this processor do. This processor needs to parse the date before it can be printed into the index name with the desired format. So there is some code duplication, but I think that is ok. An alternative would be to come up with a common base class that then the date
and this processor extend from, but I wasn't too fund of the idea either.
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 agree
|====== | ||
| Name | Required | Default | Description | ||
| `field` | yes | - | The field to get the date or timestamp from. | ||
| `index_name_prefix` | yes | - | A prefix of the index name to be prepended before the printed date. |
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.
what if a user wants the index name to only be the date value?
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 point. I can make that option to be not required.
b585c01
to
385b84f
Compare
@talevy I made |
LGTM |
385b84f
to
b25ae4e
Compare
b25ae4e
to
7aca138
Compare
The processor added in this PR dynamically redirects a document to an index based on a provided index name prefix, a date or timestamp field in the document being processed and the provided date rounding.
PR for #17814