On 14 mars 2011, at 16:33, Hardy Ferentschik wrote: >> - move Facet methods hosted on FTQuery to a FacetManager interface and do >> ftQuery.getFacetManager().enableFacet("cdscds"); > no sure about this one. What other benefits does this approach have except > the reuse for the JPA query?
My concerns are: - it's easier for someone to know what operations are available wrt faceting if there is an interface to host them all and have a nice JavaDoc + code example - it seems this feature is still in flux so adding new methods related to faceting is a real possibility in the future - with the most simple approach, we already have 3 methods related to faceting. The the alternative one, we are at 4 methods. In a nutshell, the current approach is less future proof in an area that will probably evolve / improve. > >> - make FacetRequest / FacetResults interfaces? > After discussion this morning I actually got rid of FacetResult, since in the > end one is only interested in > the actual Facets. What are you returning then? Map<String,List<Facet>> getFacetResults? I'm not a huge fan: - I find it more cryptic than - one cannot really rely on equals / hashCode if needed (not sure that's necessary though) - you have to be sure that you will never ever need to add addition contextual information on the concept of results - the toString is nicer :) > >> - Facet should implement equals / hashCode or else we cannot remember the >> facet selected > +1 > >> - //TODO should the index be included in object Facet? Not sure but worth >> thinking about => probably not if Facet objects change indexes from one >> query to the other > Not sure what you mean. I was thinking of adding getIndex on Facet as it is likely to be the link between a UI fwk and Hibernate Search but adding this info would cause more problems than it solves. > >> - should we rename Facet to FacetElement? We seem to talk about Facets as >> the global concept whereas Facet the object represent one of the results of >> the Facet. > For me the global concept is "Faceting" and a Facet is indeed a single result. > But I see where you are coming from. We call it FacetRequest and enableFacet() > Maybe we should rename these though. FacetingRequest? It's just so much > harder to pronounce ;-) I'd go for faceting on the upper objects. That'd be clearer to be. Faceting is pronounced Facet - ing :) _______________________________________________ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev