-
Notifications
You must be signed in to change notification settings - Fork 736
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 support for specifying a pipeline when indexing documents #1455
Conversation
@ruflin I added the And I would like some guidance about the best way to cover this with tests. |
@ruflin could you give me the necessary indications so that I can finish this PR ? |
@stof Sorry for the late reply, only was partially online the last days. I think having it in The testing here is a bit trickier as you have to create a pipeline first in Elasticsearch. I would probably do that through Elastica by using php-elasticsearch as ingest does not really exist yet in Elastica. Best go for a simple processor like rename inside the pipeline which then should also make it easy to test if the document was actually processed as expected. Cleaning up the pipeline after the test would be great, but I'm also ok if it sticks around if this gets too complicated. |
@ruflin actually, for bulk requests, this goes in the bulk params, not in each document. Writing the test made me realize this mistake in my PR (I'm already using the pipeline when indexing documents with the lower-level API, but I was not using the bulk API). and the update API does not support pipelines yet (this is discussed in elastic/elasticsearch#17895) So does it still make sense to have it in the Document object ? |
039cecf
to
fc301b3
Compare
Tests are written though. They are currently leaking the rename pipeline, as ensuring that the cleanup is done even in case of test failure would involve wrapping the whole test in a |
anyway, |
@stof Thanks for the details and changes. I will probably only have time to have a detailed look and think about it beginning next week. It's definitively on my todo list ;-) |
@stof I'm positively surprised that using a pipeline with the bulk API already works as you showed in your tests. I wonder if that is enough for now or if we need a deeper integration? For your PR I'm good to merge as is if your are ok with it and would add a Changelog. We can perhaps have a follow up discussion in an issue about the bulk part. |
fc301b3
to
3ba96bb
Compare
@ruflin I'm OK with merging this PR as is (and I added the changelog) |
@@ -2,14 +2,16 @@ | |||
All notable changes to this project will be documented in this file based on the [Keep a Changelog](http://keepachangelog.com/) Standard. This project adheres to [Semantic Versioning](http://semver.org/). | |||
|
|||
|
|||
## [Unreleased](https://github.com/ruflin/Elastica/compare/6.0.0...master) | |||
## [Unreleased](https://github.com/ruflin/Elastica/compare/6.0.1...master) |
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 catch
Closes #1453