-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elasticsearch High Level Client has a transitive dependency to Lucene #29184
Comments
See a related discussion here: #23331 (comment) Not sure if we need to keep that issue opened though as we know we want to go that way anyway. |
@dadoonet I can see how the end goal would be to not depend on Elasticsearch itself but AFAICS from the issues it does not seem to be something we would have early. Trimming down the dependency tree could be a good first step, that can be done right away without requiring too much work as it would just require adding some exclusions. |
IIRC it's because some builders depends on Lucene and some other classes like Version as you mentioned. So excluding Lucene is just not that easy. But that's my 2 cents on this. I prefer having @javanna answering :) |
Pinging @elastic/es-core-infra |
I am not extremely sure that using |
We discussed this today with the team as part of our FixItFriday. As said above the plan is for the high-level REST client to not depend on Elasticsearch. There is work in progress to allow for this, for instance to remove the lucene dependency from our xcontent code. There is much more to be done and we agreed that the lucene |
We actually return some Lucene classes on the objects that come out of the high level rest client. |
Thanks for the update. I see this is not a trivial issue. We will wait :) |
I'm happy to see that ES team is going in this direction : have a lightweight client that is independent from elasticsearch server jars. On the other way, some parts of elasticsearch core code are very useful to keep in high level client : these are all the query builders. |
This issue fix is highly anticipated. Trying to embed Java Highlevel client into Alfresco system became a nightmare. |
Is there any plan for this on the roadmap? From the earlier conversation, it sounds like this is desirable and there was work towards this a year ago, but I don't see any target release/milestones on the ticket. At the risk of overstepping...: This has been one of the few areas where elastic falls well behind in feature-comparison with other search applications. Writing queries/indexing (and index management operations) with the low-level client feels like re-inventing the wheel, and there are concerns about the maintenance burden moving forward of keeping our JSON-builders up to date with the rest apis. I'd imagine the heavy-weight client is also a concern for any cloud-based 'serverless' applications. tl;dr: Would love to see this as a priority in the 7.x product :) |
As a temporary solution Maven Shade plugin could be used. Like it is listed for Low Level Client. Example with shading all of dependencies is below.
|
Thanks. We'll keep that in mind if we run into any more dependency issues. Still hoping we'll see a lightweight client someday soon. |
If you want a lightweight client right now, there is Jest : |
This looks really an high hanging fruit. |
For the record, in Quarkus we add the following exclusions to the Elasticsearch High Level Client dependency.
|
Thanks for the share @loicmathieu ! |
Closing this as we've removed the high level rest client in favor of the Java client. |
Elasticsearch version (
bin/elasticsearch --version
): 6.2.3Plugins installed: N/A
JVM version (
java -version
): anyOS version (
uname -a
if on a Unix-like system): anyDescription of the problem including expected versus actual behavior:
The Elasticsearch High Level Client seems to depend on internal Elasticsearch code, and ends up having a transitive dependency to Lucene itself.
Given the goal of the client is to be used in remote servers, where no actual indexing is performed, one would expect the client to not have any dependency to Lucene, and to only manipulate JSON data.
This dependency is a problem for applications that also happen to use Lucene locally, for other purposes. It creates complex dependency management issues when trying to find a version of Lucene that will suit both the Elasticsearch High Level Client and the specific application needs.
These applications cannot just exclude the dependency from the client to Lucene, because the client seems to be using Lucene's
Version
class at some point.Would it be possible to trim down the dependency tree of the Elasticsearch High Level Client, excluding the Lucene dependency in particular, and avoiding the use of Lucene's
Version
class?For the record, here is the dependency tree for the Elasticsearch High Level Client version 6.2.3:
Steps to reproduce:
Provide logs (if relevant): N/A
The text was updated successfully, but these errors were encountered: