[hibernate-dev] [hsearch] JSON version of Hibernate Search query
Emmanuel Bernard
emmanuel at hibernate.org
Thu Jun 13 15:20:12 EDT 2013
On Thu 2013-06-13 16:10, Hardy Ferentschik wrote:
>
> On 13 Jan 2013, at 2:11 PM, Gunnar Morling <gunnar at hibernate.org> wrote:
>
> > 2013/6/13 Hardy Ferentschik <hardy at hibernate.org>
> >
> > On 13 Jan 2013, at 8:47 AM, Gunnar Morling <gunnar at hibernate.org> wrote:
> >
> > > Would creating a "real" query language instead of a serialized object
> > > representation make sense then?
> >
> > You mean the Lucene query language - http://lucene.apache.org/core/old_versioned_docs/versions/3_4_0/queryparsersyntax.html ;-)
> > In the end it comes down to that.
> >
> > Maybe, if that has everything needed, why not? Or is a goal to hide the fact that Lucene is used underneath?
> >
> > What would the purpose of a new query language be? I guess it would be more object centric, but is this relevant for a user?
> >
> > What's the purpose of the JSON notation? I think for a user its nicer to express a query in a dedicated query language instead of a general-purpose object serialization format. As it is nicer for a human to express queries in say HQL or SQL instead of describing e.g. a "HQL object" in JSON or XML. If this is going to be used by application code, it probably doesn't make a big difference.
> >
> > I guess I just don't yet really understand what's the use case behind.
>
> Right, that's what I am also trying to see/find.
Sorry, I got confused by your question initially. The query language is not for an
end-user, it is for developers or machines.
JSON here was used as an example of serializable format. The problem I
was trying to address is to serialize the query in a platform agnostic
way.
We could try and design an ad-hoc query language for Hibernate Search queries or try
and see if HQL could fit all the features but that's certainly more work
(incl to later bind it back to actual calls to the query API.
I don't think reusing Lucene's query language is the right thing. For
once it does not handle faceting, spatial, etc and it maps more to each
Lucene *Query object which is at a lower and more plumbing level that
HSearch query DSL API offers.
Emmanuel
More information about the hibernate-dev
mailing list