Hibernate search + elastics search are on the same boat, but this boat flow

elastic is great but elastic HttpRestClientApi is very too dependent of Lucene ! why did you include all server in the RestApiClient (lucene include) for request an external elasticsearch node ?

My probleme is that i use hibernatesearch elastic search backend to create index and auto index document. I need to request elasticsearch to extract statistics and for that i user the rest api client.

But that a big deal, hibernatesearch include Lucene 5.5.5, elasticsearch in the last 5.6.8 version include lucene 7 and a big conflicts are unsolved. I exclude with maven all dependencies of Lucene for Elasticsearch server package, i create a fake class of Version.java (package org.apache.lucene.util; ) launch and compile. In this step i thinks that work. But my project use liquibase for track and create database migration. And again a lucene dependancies appear... if i remove all elasticsearch package and comment the code for ElasticSearch : no problem to compile, launch, and goal liquibase.

with elasticsearch and goal liquibase :
Exception in thread "main" java.util.ServiceConfigurationError: An SPI class of type org.apache.lucene.codecs.PostingsFormat with classname org.apache.lucene.search.suggest.document.Completion50Postin
gsFormat does not exist, please fix the file 'META-INF/services/org.apache.lucene.codecs.PostingsFormat' in your classpath.
at org.apache.lucene.util.SPIClassIterator.next(SPIClassIterator.java:160)
at org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:70)
at org.apache.lucene.util.NamedSPILoader.(NamedSPILoader.java:51)
at org.apache.lucene.util.NamedSPILoader.(NamedSPILoader.java:38)
at org.apache.lucene.codecs.PostingsFormat$Holder.(PostingsFormat.java:49)
at org.apache.lucene.codecs.PostingsFormat.forName(PostingsFormat.java:112)
at org.apache.lucene.codecs.lucene54.Lucene54Codec.(Lucene54Codec.java:161)
at org.apache.lucene.codecs.lucene54.Lucene54Codec.(Lucene54Codec.java:81)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

my question and my request is : Why did you include all elasticsearch server in the Rest Api client ? Why did you need to know the lucene version ? by read of codesource, the RestApiClientApi just need elasticsearch package for Serialise / deserialize object send and receive by the server... can you extract this part, package it, reuse it in the server and in the Rest Api Client instead of include all elasticsearch server with lucene inside the RestApiClient ?

by read of codesource, the RestApiClientApi just need elasticsearch package for Serialise / deserialize object send and receive by the server..

I wish that would be so easy.
But that requires a lot of work.

If it clashes with what you have, you can use the low level client but you won't have any request builder or response parser.

What you'd like to see is on his way. The team is decoupling more and more the existing code and splitting in modules which would hopefully make that possible at some point.

i hope that in the future we will can use the high rest client java api without any conflict with an other lucene version in other package.
I will use the low rest client api but i need to implement some serializable class to read the response receive from server... this is for the moment the best way to have some code reusable and upgradable with some new version of elasticsearch. i will look the next version of elasticsearch and the api to know when this update is done.

I also have/had a dependency on Lucene that could not be broken, so I used
the Jest client instead https://github.com/searchbox-io/Jest

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.