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

Sanne Grinovero sanne at hibernate.org
Wed Aug 24 05:31:59 EDT 2011


2011/8/24 Hardy Ferentschik <hardy at hibernate.org>:
> 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?

>From the IndexReader you can iterate a specific field's values; that's
how faceting is built and why I think the forum poster was mentioning
faceting;
the faceting field works very similarly to a "distinct" selection on the term.

>
>> 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.

Ok, this is HSEARCH-868 then.

>
> --Hardy
>
>
> _______________________________________________
> 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