loopbackio / loopback-connector-elastic-search

Strongloop Loopback connector for Elasticsearch
MIT License
78 stars 56 forks source link

Only provide indexName in exists-method #65

Closed ernie58 closed 4 years ago

ernie58 commented 7 years ago

... so that the HEAD-request generated by the elasticSearch-client doesn't have a body. The body causes a 403-forbidden response on amazon AWS ElasticSearch service

slnode commented 7 years ago

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

pulkitsinghal commented 7 years ago

@aquid - this PR isn't central to you or me but it is very important to the community. Please look it over and let's try to get this out the door too

pulkitsinghal commented 7 years ago

@ernie58 - dumb question but do you think that this is something the underlying ES client should be expected to optimize? while we treat it as a workaround? Or is this something that definitely we - the users of ES client - must always handle?

ernie58 commented 7 years ago

@pulkitsinghal I think ES client shouldn't optimize it, because direct users of the client can decide themselves what to pass to the client.exists function

see https://github.com/elastic/elasticsearch-js/blob/67c931c5de3a8a0a6e7e7c8bac19b7c77d379380/docs/_examples/exists.asciidoc

When using the connector you have no control as an end user

What do you think?

aquid commented 7 years ago

@pulkitsinghal I think this PR is important and we should also test this before merging. @ernie58 Can you update the PR with some tests too if you have some more extra time to contribute or else I will add this to my task list for the connector.

ernie58 commented 7 years ago

@aquid I'll put it on my list this week