[hibernate-dev] [HSearch] Facet drilldown
Emmanuel Bernard
emmanuel at hibernate.org
Mon Mar 14 10:00:59 EDT 2011
On 14 mars 2011, at 12:03, Emmanuel Bernard wrote:
>
> On 14 mars 2011, at 11:46, Sanne Grinovero wrote:
>
>>>
>>>
>>> What you are loosing by query.getFacets( facetName ) is the ability to
>>> iterate over the
>>> enabled facets. At the very least you have to take care yourself of which
>>> facet names are set.
>>> In intermediate step would be to get rid of FacetResult, but keep returning
>>> a Map.
>>> So instead of Map<String, FacetResult> we have a Map<String, List<Facet>>.
>>> Or we go query.getFacets( facetName ), but also add a
>>> query.getEnabledFacetNames()
>>
>> In which case you do iterate per facets? I couldn't find examples, but
>> your mid-in suggestions seems fine.
>
> Please don't pollute the FTQuery interface more than it needs. Use delegation to add features as much as you can.
Actually, I think we should have a FacetManager interface that hosts all the facet related methods of FullTextQuery
ftQuery.getFacetManager().enableFacet( "oh-my" );
It's easier for people to find and that can be reused by JPA's FullTextQuery (not implemented today BTW).
More information about the hibernate-dev
mailing list