Multiple BrowseSelections based on MultiValueFacetHandler result in zero results

160 views
Skip to first unread message

mschipperheyn

unread,
Apr 18, 2012, 11:28:24 AM4/18/12
to bobo-browse
Hi,
I have a problem with multiple selections and I can't seem to find why
it's going wrong.
When I add *two* BrowseSelections for Facets based on
MultiValueFacetHandler, I get *zero* results.
When I add *one* BrowseSelection for Facets based on
MultiValueFacetHandler, I get *normal* results.
When I add one BrowseSelections for a Facet based on
MultiValueFacetHandler and one for a Facet based on
SimpleFacetHandler, I get *normal* results.
When I add one BrowseSelections for a Facet based on
MultiValueFacetHandler and one for a Facet based on RangeFacetHandler,
I get *normal* results.

This has all been tested against Luke to confirm that results should
be there.

<bean id="categoryFacet"
class="com.browseengine.bobo.facets.impl.MultiValueFacetHandler"
parent="facetHandler">
<constructor-arg value="category" type="java.lang.String"/>
<constructor-arg value="category.id" type="java.lang.String"/>
</bean>

<bean id="cityFacet"
class="com.browseengine.bobo.facets.impl.MultiValueFacetHandler"
parent="facetHandler">
<constructor-arg value="city" type="java.lang.String"/>
<constructor-arg value="city.id" type="java.lang.String"/>
</bean>

When I turn them into SimpleFacetHandler I get normal results

<bean id="categoryFacet"
class="com.browseengine.bobo.facets.impl.SimpleFacetHandler"
parent="facetHandler">
<constructor-arg value="category" type="java.lang.String"/>
<constructor-arg value="category.id" type="java.lang.String"/>
</bean>

<bean id="cityFacet"
class="com.browseengine.bobo.facets.impl.SimpleFacetHandler"
parent="facetHandler">
<constructor-arg value="city" type="java.lang.String"/>
<constructor-arg value="city.id" type="java.lang.String"/>
</bean>

This seems like a bug to me, but I hope it's something I'm doing
wrong. Could someone suggest something to me?

BoboIndexReader boboReader =
BoboIndexReader.getInstance(reader,handlerList);
BrowseRequest br=new BrowseRequest();
br.setCount(10);
br.setOffset(0);

BrowseSelection sel=new BrowseSelection("city");
sel.addValue("10");
br.addSelection(sel);

BrowseSelection sel=new BrowseSelection("category");
sel.addValue("15");
br.addSelection(sel);

QueryParser parser = new QueryParser("contents",new
StandardAnalyzer(Version.LUCENE_CURRENT));
Query q=parser.parse("cool car");
br.setQuery(q);

FacetSpec catSpec = new FacetSpec();
catSpec.setOrderBy(FacetSortSpec.OrderValueDesc);
catSpec.setMaxHitCount(20);

FacetSpec citySpec = new FacetSpec();
citySpec.setMinHitCount(1);
citySpec.setOrderBy(FacetSortSpec.OrderHitsDesc);

br.setFacetSpec("category",catSpec);
br.setFacetSpec("city",citySpec);

SortField sort = new SortField("sortDate",SortField.LONG,true);

br.setSort(new SortField[]{sort});

I'm using Bobo Browse 3.0.1/Lucene 3.5

Volker

unread,
Apr 19, 2012, 8:14:33 AM4/19/12
to bobo-...@googlegroups.com
one question:

you mean two browseselections for different facets, not for oneMultiValueFacetHandler, am I right?

I can't spot an error in your code. I can only say, that this is working in my configuration.

regards

mschipperheyn

unread,
Jun 12, 2012, 9:48:09 AM6/12/12
to bobo-...@googlegroups.com
Two browse selections for different facets, yes.

I'm going bonkers on this. 

The other thing I'm noticing is that in some case, if I select

* One element in a MultiValueFacet (let's say, I choose category Van) with expandSelection:true: I will get 5 results and the facet distribution for a SimpleFacet, say color (red,green,blue). I also will get category Sedan as an option

* If I then select: color: red, I will get zero results, but still have for example category Sedan as an option. If I select it (so: Van+Sedan+Red), I will get the expected results.

In the above case there are Red Sedans and Vans. Also in Luke, I get the expected results when using the Red Van as a selection criterium. It's even weirder to me because in other cases, this combination of MultiValueFacet and SimpleFacet does work.

It doesn't make any sense to me and I don't know how to debug this.

I've described this examples as cars and colors but the actual example is about Tags (MultiValueFacetHandler) and Languages (SimpleFacetHandler)

This is the browse request

query: +countrySite.site.id:2 +hide:false
page: [0,24]
sort spec: [<string: "closed">, <long: "recentPostCount">]
selections: {tags=name: tagsvalues: [16]nots: []op: ValueOperationOrsel props: {}, language=name: languagevalues: [5]nots: []op: ValueOperationOrsel props: {}}
facet spec: {tags=orderBy: OrderHitsDesc
max count: 0
min hit count: 1
expandSelection: true, recency=orderBy: OrderValueAsc
max count: 0
min hit count: 1
expandSelection: false, groupCountry=orderBy: OrderValueAsc
max count: 0
min hit count: 1
expandSelection: true, popular=orderBy: OrderValueAsc
max count: 0
min hit count: 1
expandSelection: false, language=orderBy: OrderValueAsc
max count: 0
min hit count: 1
expandSelection: true}
fetch stored fields: true
group by: null

executing the query in Luke like this 
returns the correct results

Cheers,
Marc

mschipperheyn

unread,
Jun 18, 2012, 8:40:09 AM6/18/12
to bobo-...@googlegroups.com
Any ideas on where I should look?

John Wang

unread,
Jun 20, 2012, 2:31:20 AM6/20/12
to bobo-...@googlegroups.com
Hi Marc:

    Can you maybe share a small index and the request you are trying to send? From what you are describing, it seems to be a straightforward usecase.

-John

--
You received this message because you are subscribed to the Google Groups "bobo-browse" group.
To view this discussion on the web visit https://groups.google.com/d/msg/bobo-browse/-/-aXhekH2Et0J.

To post to this group, send email to bobo-...@googlegroups.com.
To unsubscribe from this group, send email to bobo-browse...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bobo-browse?hl=en.

mschipperheyn

unread,
Jun 20, 2012, 8:19:29 AM6/20/12
to bobo-...@googlegroups.com
Ok, I'll do that.
To unsubscribe from this group, send email to bobo-browse+unsubscribe@googlegroups.com.

mschipperheyn

unread,
Jun 20, 2012, 11:31:59 AM6/20/12
to bobo-...@googlegroups.com
Hi John,

I created a test case for this and added it to https://linkedin.jira.com/browse/BOBO-102

Cheers,
Marc


On Wednesday, April 18, 2012 12:28:24 PM UTC-3, mschipperheyn wrote:

mschipperheyn

unread,
Jun 28, 2012, 2:43:30 PM6/28/12
to bobo-...@googlegroups.com
Hi John,

I thought that posting a complete maven test case, that is installable as an eclipse project would be enough for some feedback. Apparently, it isn't.
If you tell me what else I can do so you can give me some meaningful feedback, I will do it.

Thanks
Marc


On Wednesday, June 20, 2012 3:31:20 AM UTC-3, John Wang wrote:
To unsubscribe from this group, send email to bobo-browse+unsubscribe@googlegroups.com.

John Wang

unread,
Jun 28, 2012, 5:22:52 PM6/28/12
to bobo-...@googlegroups.com
Hi Marc:

     I am sorry there is such a delay. There has been some delay at work. But what you have provided is enough. We will try to get you a solution this week.

-John

To view this discussion on the web visit https://groups.google.com/d/msg/bobo-browse/-/zjTiQGQ7JS4J.

To post to this group, send email to bobo-...@googlegroups.com.
To unsubscribe from this group, send email to bobo-browse...@googlegroups.com.

mschipperheyn

unread,
Jun 28, 2012, 7:41:33 PM6/28/12
to bobo-...@googlegroups.com
Great, that would be awesome!

Lei Wang

unread,
Jun 29, 2012, 4:51:30 PM6/29/12
to bobo-...@googlegroups.com
Fixed on the master branch.

- Lei
To view this discussion on the web visit https://groups.google.com/d/msg/bobo-browse/-/Duq7_-smiZ8J.

To post to this group, send email to bobo-...@googlegroups.com.
To unsubscribe from this group, send email to bobo-browse...@googlegroups.com.

John Wang

unread,
Jul 1, 2012, 11:22:11 AM7/1/12
to bobo-...@googlegroups.com
Marc:

    The problem was introduce from a refactor that does a heuristic based decision making to use the inverted or the forward index. In this case, your facet name is different from the indexed field name, the bug was that the facet name is passed down to inverted index looking for the index field name: tags. This only affected MultiValueFacetHandlers.

     Thanks Lei for tracking this down and fixing it.

-John

mschipperheyn

unread,
Aug 7, 2012, 2:50:34 PM8/7/12
to bobo-...@googlegroups.com
Thanks for fixing this
Reply all
Reply to author
Forward
0 new messages