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 ? |
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. |
@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) |
ruflin
Feb 23, 2018
Owner
Good catch
Good catch
Closes #1453