Comments (5)
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.
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.
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.
As long as it doesn't compromise the backend :-)
from elastic4s.
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)
- Multisearch ignores memory circuit breaker errors HOT 1
- Update to cats-effect 3.5+
- Add runtime fields support to `MappingDefinitionLike` HOT 2
- Implement ScriptScoreQuery HOT 2
- opensearch compatibility HOT 9
- Add support for PIT in search
- ElasticProperties accepts invalid input and runs with only single node HOT 1
- [Force merge index] Can not force merge asynchronously
- WAND optimization with a numeric track_total_hits parameter
- Using REST API compatibility
- Support for highlights in TopHitsAggregation
- Elasticsearch server version for tests is not up-to-date and tests are failing when updating HOT 2
- SearchHit.sourceAsString adds superfluous type metadata HOT 2
- IndicesExistsRequest with allowNoIndices = true always returns true HOT 1
- `getIndex` doesn't support date math in index aliases HOT 1
- `indexExists` always returns `true` if index string contains `*` HOT 2
- `.sourceExclude` and `.sourceInclude` are mutually exclusive HOT 1
- docAsUpsert not working as expected
- ElasticSource does not clear it's scroll HOT 1
- Add Synonyms API support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elastic4s.