Git Product home page Git Product logo

Comments (5)

sksamuel avatar sksamuel commented on June 15, 2024

Have a read of this
http://www.elasticsearch.org/guide/reference/modules/http/

And then the examples on elastic4s on how to use transports.

If that's not helpful then post up your config file and I'll help you further.

from elastic4s.

stig avatar stig commented on June 15, 2024

Hi Sam,

I am attempting to use a third-party elasticsearch hosting provider. The problem is they only offer connectivity over HTTP, and I have not been able to get this client to connect over that. (Not even to a local elasticsearch running on my machine.) I have tried to connect to a stand-alone elastic search instance over http by doing this:

val client = ElasticClient.remote("127.0.0.1", 9200)

However, this fails with a org.elasticsearch.client.transport.NoNodeAvailableException: No node available exception. I can absolutely connect to that over the REST API using CURL from the commandline, so the node is alive and well:

curl '127.0.0.1:9200/twitter/_search?q=foo'

It appears that the remote method assumes it should be making a TCP connection. I have tested this by changing the connection port to 9300, which is the default TCP port, and this works.

Unfortunately, as stated above, none of the third-party elastic search providers I've looked at exposes a TCP endpoint. And self-hosting is not an option for us at the moment, unfortunately.

This client has the nicest DSL of the clients I've looked at, so I would prefer to use it. But if it cannot work over HTTP I simply cannot at this time. :-(

Stig

from elastic4s.

sksamuel avatar sksamuel commented on June 15, 2024

Ok I understand now. Then no you can't use elastic4s or any of the other clients. Your only option is https://github.com/searchbox-io/Jest

I guess since I'm generating lots of json inside the client it would be possible to turn elastic4s into a full http client as well as a node client, I'll look at that.

from elastic4s.

stig avatar stig commented on June 15, 2024

As long as it doesn't compromise the backend :-)

from elastic4s.

aparo avatar aparo commented on June 15, 2024

In pyes, I'll alternate thrift and http on the same layer in python.
On JVM there are always pros/contros on using native client (port 9300).

Pros mainly are:

  • faster
  • high dependence from elasticsearch.jar, just is always updated

Contros:

  • unable to use third part calls/plugin: they only work on http or thrift
  • the internal ElasticSearch APIs change very fast. Requiring continuos migration of maintained source base.
  • the elasticsearch.jar overhead ~10Mb plus others.
    I think that in future using several other protocols is a must.

The documentation elastic4s refers to HTTP calls, but we know that elastic4s now executes only native calls.

To provide HTTP calls without depending on elasticsearch.jar a lot of classes mapping queries, filters and facets must be written. I'll give a look to jest (last time I looked its code it was not well structured. I hate write JSON by hand. )
I'll create a branch to test the possibility to refactory the code to used both for native than for HTPP/Thrift. Probably we'll need to create a DSL factory that it's mapped to two implementation native and HTTP.

from elastic4s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.