-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Generic handler #71
Generic handler #71
Conversation
Added a Fields method to ScanService that allows the caller to speficy the fields to load. The Reindexer now requests the _parent and _router fields (on top of the default _source field). When the reindexer finds those fields in the hit, it sets them on the IndexRequest. In index_test: Added a new 'comment' type that is a child of 'tweet' together with its mapping. Added a comment instance to the test dataset.
👍 Much better than before. Flexible and simpler design. Is |
If we're going to stay with |
Okay, I see that you've renamed the callback. I think it's better now. Are you still working on some details? Otherwise I'll merge it. |
I think it's good like this. Thank you for pushing the enveloppe |
Added a Fields method to ScanService that allows the caller to speficy the fields to load. Redesigned the Reindexer and make it more generic. It now takes a ReindexerFunc that is responsible for consuming a SearchHit and handling the bulk operation (e.g. indexing, updating, deleting, or skipping the document). The default operation is CopyToTargetIndex which copies the SearchHit into the target index. CopyToTargetIndex also gracefully handles the _parent and _routing fields (on top of the default _source field). When CopyToTargetIndex finds those fields in the hit, it sets them in the IndexRequest. Tests: Added a new 'comment' type that is a child of 'tweet' together with its mapping. Added a comment instance to the test dataset. Also added some more Reindexer tests. Thanks to @nwolff for this PR. Closes #68 and #71.
It was a pleasure working with you. Thank you. |
Same here, cheers! |
The reindexer now takes a HitHandler than can emit any kind of BulkRequest
We provide a CopyToTargetIndex function to handle the common case of straighforward copying from one index to another.