I'd like to propose a change to the facet response structure.  Currently, it
looks like:
{'facet_fields':{'field1':[('value1',count1),('value2',count2),(null,missingCount)]}}

My immediate problem with this structure is that null is not of the same
type as the 'value's.  Also, the meaning of the (null,missingCount) tuple is
not the same as the meaning of the ('value',count) tuples, it is a special
case to represent the documents for which the field has no value.  I'd like
to propose changing the response to:
{'facet_fields',:{'field1':{'facets':[('value1',count1),('value2',count2)],'missing':missingCount}}}


In addition to cleaning up the 'null' issue mentioned above, I think this
will allow for greater flexibility moving forward with the facet component. 
For instance, it would be great if the FacetComponent could add an optional
count of the 'hits', or number of distinct facet values contained in the
query result.  If the facet request has a limit on it, this number is not
available via a count of the returned facet values.  The response structure
I've outlined above could accomodate this piece of metadata very easily:
{'facet_fields',:{'field1':{'facets':[('value1',count1),('value2',count2)],'missing':missingCount,'hits':hitsCount}}}


What does everyone think?  I'd be happy to submit a patch to solr (for 1.5,
of course), if the solr community is in favor of it.


-- 
View this message in context: 
http://www.nabble.com/Facet-Response-Structure-tp25407363p25407363.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to