ropensci / elastic

R client for the Elasticsearch HTTP API
https://docs.ropensci.org/elastic
Other
245 stars 58 forks source link

es_ver(): what happens when an ES instance doesn't provide version information? #234

Closed sckott closed 3 years ago

sckott commented 5 years ago

via https://github.com/metacran/seer/issues/12

ES version information is essentially required to use this pkg.

I think the solution might be to have a separate config option to either

sckott commented 5 years ago

wil wait to see if others see this problem as well

maelle commented 4 years ago

I tried running

conn <- elastic::connect(port = 80,
                         host = "search.r-pkg.org",
                         path = "package/_search")

elastic::Search(conn, q = 'Author = "Chamberlain"')

and ran into the problem mentioned in this issue.

All the possibilities you mention seem ok to me, but in the case I haven't passed an argument and the package guesses the version from the root, I'd expect a message.

sckott commented 4 years ago

thanks @maelle having a look

sckott commented 4 years ago

seems like you don't actually need the path defined in connect(), eg..,

conn <- connect(port = 80, host = "search.r-pkg.org")
conn$ping()
conn$es_ver()
Search(conn, q = 'Author = "Salmon"')$hits$total
maelle commented 4 years ago

Oh, thank you! 🎉

sckott commented 3 years ago

closing, no other pings on this