[hibernate-dev] [Search] ElasticSearch - DSL

Gunnar Morling gunnar at hibernate.org
Thu Jan 28 12:52:56 EST 2016


Hi Guillaume,

Indeed there is a reason for not using the DSL: I wanted to avoid the
dependency to the ES libraries.

They in turn pull in Lucene in a version which potentially differs
from the Lucene version used by Hibernate Search itself. Also I wanted
to leave the door open for supporting multiple (potentially
incompatibly altered) versions of ES backends, say ES 2 and a future
ES 3.

All in all, these advantages outweigh the slightly simpler usage of
the DSL to me.

> One of the challenges waiting for us will be to transform the Lucene
> Filters into proper Elastic Search queries

I haven't looked into filters yet, but it's high on my agenda.

Do you think it's more difficult than transforming actual queries?
Btw. the ES PoC allows to pass in plain ES queries, at some point
these should be allowed to contain filter clauses, too (this might
even work already, haven't tried it).

Cheers,

--Gunnar



2016-01-28 18:16 GMT+01:00 Guillaume Smet <guillaume.smet at gmail.com>:
> Hi all (and especially Gunnar),
>
> I dug a bit in your ElasticSearch work today as I wanted to give a try to
> the facet implementation and I was wondering if maybe we should use the
> ElasticSearch DSL to build the queries instead of building raw JSON strings.
>
> I experimented here:
> https://github.com/gsmet/hibernate-search/commit/18737f720a1200b125adf2bb0465b52d5d2b3ca3
>
> I think the code is a bit clearer now. I haven't changed all the queries in
> the tests so I kept the fromJson method in ElasticSearchQueries but I think
> we should remove it and rely on the DSL: I'll wait for your opinion as you
> might have had a very good reason to not use the DSL.
>
> One of the challenges waiting for us will be to transform the Lucene
> Filters into proper Elastic Search queries.
>
> --
> Guillaume
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev


More information about the hibernate-dev mailing list