koopjs / koop-provider-elasticsearch

A provider for koop that can connect to one or more elastic search instances and turn indices/aliases into individual feature services.
Apache License 2.0
13 stars 4 forks source link

Provider is not working with latest koop version 4.X #15

Closed sjain227 closed 3 years ago

sjain227 commented 3 years ago

I have just updated koop with it's latest version 4.0.3 and found that Elastic search provider is throwing error - {"error":"features.forEach is not a function"} Anything needs to be updated in elastic search model?

keithfraley commented 3 years ago

Is most like the es node client. What once was response.hits.hits is now response.body.hiits.hits

On Tue, Nov 3, 2020, 12:19 AM sjain227 notifications@github.com wrote:

I have just updated koop with it's latest version 4.0.3 and found that Elastic search provider is throwing error - {"error":"features.forEach is not a function"} Anything needs to be updated in elastic search model?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/koopjs/koop-provider-elasticsearch/issues/15, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6LCVGJMCDJKMZIOUHV67TSN6OINANCNFSM4TIKYWQQ .

sjain227 commented 3 years ago

@keithfraley I have not updated ES version, hence res.hits.hits is working fine for me, I noticed one strange thing that when we hit service for the first time, it returns the results correctly then onwards it starts throwing error. It does not even call getData function second time on. I see getData is now bound function, Could that be an issue?

rgwozdz commented 3 years ago

@sjain227 - this a bug in koop 4.x.; patch coming shortly

rgwozdz commented 3 years ago

@sjain227 - please try with Koop ^4.0.4

sjain227 commented 3 years ago

@rgwozdz Thanks a lot Rich for the patch, it works fine with Koop 4.0.4