Fixes #2136: Support for additional HTTP headers in apoc.es procedures #3953
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2136
Issue changes
Added
config
parameter (optional) to all procedures, which is handled by ElasticSearchConfig.java.This parameter can have an entry
headers: <headerMap>
which can be used to add headers to the default{content-type: "application/json", method: "<procedureMethod>"}
.The document created via
apoc.es.post
andapoc.es.postRaw
inElasticSearchTest.java
are currently deleted with anapoc.es.postRaw
in which theDELETE
method is forced, since there is no apoc.es.delete.But there is an issue to add it:
https://github.com/neo4j-contrib/neo4j-apoc-procedures/issues/2999
.Although it is conceptually wrong for an
apoc.es.post*
to do a delete, I would leave it that way for now and change to the apoc.es.delete when it implemented.Alternatively, we could put all these test cases within the static method insertDocuments() , without then having to do
delete
, but imo it is not an optimal solution.Other changes
Created tests with getRaw and postRaw (even without config headers), which were not present