-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Restricting results by >1 facets of the same faceting group
PostPosted: Thu Jun 30, 2011 9:43 am 
Beginner
Beginner

Joined: Mon Apr 11, 2011 7:56 am
Posts: 38
Hi again.

How should faceting behave in case of restricting the results by multiple facets from the same faceting group (i.e. having hte same faceting name)?

Example:
Let's assume that a query in a bibliography results in publications and there appear to be 3 authors in the results:

Results:
Code:
Publication 1
by: John, Kim

Publication 2
by: John

Publication 3
by: Kim

Publication 4
by: John, Paul

The author facets will look like this (ignoring the unrelated collections issue):
Code:
John (3)
Kim (2)
Paul (1)


What if I first restrict the results on the author facet 'John' and then 'Kim'. Shouldn't the results then only contain 'Publication 1' (like applying filters)? It currently returns Publication 1, 2 and 4, as if selecting the 'Kim' facet had no effect.


Top
 Profile  
 
 Post subject: Re: Restricting results by >1 facets of the same faceting group
PostPosted: Tue Jul 05, 2011 4:34 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
How does your domain model look like and the search/faceting code?
Atm, faceting only works on single values fields, due to the use of Lucene's field cache under the hood. This will change though in one of the next releases.


Top
 Profile  
 
 Post subject: Re: Restricting results by >1 facets of the same faceting group
PostPosted: Wed Jul 06, 2011 6:50 am 
Beginner
Beginner

Joined: Mon Apr 11, 2011 7:56 am
Posts: 38
You are right, but this is not causing the problem I'm aiming.

I found this in the source code:
Code:
private Query createSelectionGroupQuery(FacetSelectionImpl selection) {
      BooleanQuery orQuery = new BooleanQuery();
      for ( Facet facet : selection.getFacetList() ) {
         orQuery.add( facet.getFacetQuery(), BooleanClause.Occur.SHOULD );
      }
      return orQuery;
   }

Restricting the results using multiple facets on the same faceting group will thus filter by OR-ing the facets. Is it an idea to have an option for faceting groups to set the default behaviour wrt combining facets?

Some use cases:
When searching for publications, I want the publications where both 'Kim' and 'John' are author
When searching for recipes, I want dishes with both 'tomatoes' and 'eggs'.

And because the faceting implementation uses filtering, the intended publications/dishes with both constraints will not be ranked higher than publications/dishes with only one contraint.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.