Organizational Research By

Surprising Reserch Topic

SOLR faceted-search to return facet counts as with OR operator

I'll try first explain what I would like to achieve by using faceted-search in SOLR, before setting the question. Imagine I have a parameter for dog which is describing for what is dog suitable for and one dog can have multiple choices. Let's call it "housing". So dog is suitable for:

  1. indoors
  2. outdoors
  3. children
  4. old people
  5. guarding.

So basically when I use faceted search on this parameter I get the results with my current database like this (url query facet=true&facet.field=housing):

indoors (74), outdoors(63), children(71), old people(65), guarding(31).

Now when I check the indoors parameter (url query fq=housing:1&facet=true&facet.field=housing) I get the results like this:

indoors (74), outdoors(53), children(60), old people(53), guarding(15).

It is showing me that if check next parameter "outdoors", there are 53 dog which are indoors AND outdoors. I would like to get the result, which would tell "How many dogs will be added to the result if I check next option". Because there can be dogs which are suitable for outdoors only. I would like to get results like this after checking first "indoors" parameter:
indoors (74), outdoors(83), children(78), old people(79), guarding(75)
OR in other way
indoors (+0), outdoors(+9), children(+4), old people(+5), guarding(+1)

Is it something like this possible in SOLR faceted-search? Or am I using incorrect tool for achieving this. Because basically when I check "indoors" and "outdoors" I get the proper result count from the query (url query fq=housing:(1 OR 2)&facet=true&facet.field=housing). Just facet counts are not the ones I expected.

asked May 16, 2015 in SOLR by rajesh
0 votes

Related Hot Questions

2 Answers

0 votes
answered May 16, 2015 by rajesh
0 votes
answered May 16, 2015 by rajesh