[hibernate-dev] [Search] supporting DISTINCT (or similar) for values

Hardy Ferentschik hardy at hibernate.org
Wed Aug 24 05:00:28 EDT 2011


On Wed, 24 Aug 2011 10:36:39 +0200, Sanne Grinovero <sanne at hibernate.org>  
wrote:

> This was asked some times, and today a new interesting use case was
> proposed on the forums:
> https://forum.hibernate.org/viewtopic.php?f=9&t=1012360
>
> I usually tell the whole story "distinct is not fit for fulltext...
> use the relational queries"

I've seen the post and answered saying pretty much what you just said.

> but since it's often requested (on
> Infinispan Query too) and I just realized that in fact we could
> implement it as the needed information is in the index, and we could
> efficiently extract it and wrap in a nice and easy API.

As I see it, it is a special case of projection. Maybe there could be an
additional option to the 'setProjection' call.

Btw, how is this information available?

> Shall I open a JIRA for this? Likely for 4.1 I would say, for now I'm
> just collecting opinion if we should support this, and if somebody has
> an idea of how such an API should look like.

I think it is worth an issue, since it is a very typical usecase.

--Hardy





More information about the hibernate-dev mailing list