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

Add option to specify how to construct record's key from es document #3

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

DeLaGuardo
Copy link
Collaborator

No description provided.

@DeLaGuardo DeLaGuardo requested review from safi and msprunck October 18, 2023 13:39
@@ -135,10 +137,10 @@ public List<SourceRecord> poll() throws InterruptedException {

Map<String, String> sourcePartition = Collections.singletonMap("index", index);
Map<String, String> sourceOffset = Collections.singletonMap("search_after", searchAfterJson);
String key = elasticDocument.get("id").textValue();
String key = keyField != null ? elasticDocument.get(keyField).textValue() : null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it also possible to use special fields like _id?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

only those that are in the document's source. but this is adjustable, I'm even thinking about something like get-in to allow deep extraction.

@DeLaGuardo DeLaGuardo merged commit 5813b3a into main Oct 18, 2023
1 check passed
@DeLaGuardo DeLaGuardo deleted the cleanup branch October 18, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants