mfares / solrpy

Automatically exported from code.google.com/p/solrpy
0 stars 0 forks source link

No (documented?) support for additional response info such as facets #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using the following to make a query with facet display:

response =
s.query(q,start=start,rows=rows,**{'facets':'on','facets.fields':'categories'})

This is creating the correct query to solr and i've confirmed that the xml
response is correct.

The problem is that I can't access the facet results, in the xml they look
like this:

<lst name="facet_counts">
  <lst name="facet_queries"/>
  <lst name="facet_fields">
    <lst name="categories">
      <int name="collectables">10</int>
      <int name="collectables/statues">10</int>
      <int name="collectables/statues/dc-universe">10</int>
      <int name="collectables/statues/dc-universe/x-men">10</int>
    </lst>
  </lst>
  <lst name="facet_dates"/>
</lst>

Which comes directly after <result>...</result>

I can't figure out if this is incorporated in the solrpy reponse and if
there's any way to access this data.

I'm happy to hack my local version of solrpy if there's a quick fix for
this but I would have expected facet support to be a major feature.

Regards,
Andrew Ingram

Original issue reported on code.google.com by AndrewOf...@gmail.com on 19 Feb 2009 at 1:15

GoogleCodeExporter commented 8 years ago
There was a typo in my initial code, I was pluralising facet and field:

Corrected: 
s.query(q,start=start,rows=rows,**{'facet':'on','facet.field':'categories'})

I have discovered that facet information becomes available with
"response.facet_counts" which addresses the issue I was having.

Regards,
Andrew Ingram

Original comment by AndrewOf...@gmail.com on 19 Feb 2009 at 1:55

GoogleCodeExporter commented 8 years ago

Original comment by benliles on 5 May 2009 at 10:15