Umesh_ wrote:
Hi All,
I am trying to restrict facets in solr response, by setting facet.mincount =
1, which does not work as the request and response are shown below:
REQUEST:
http://localhost:8983/solr/select/?q=*%3A*&version=2.2&rows=0&start=0&indent=on&facet=true&facet.field=Instrument&facet.field=Location&facet.mincount=9

RESPONSE: <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">1</int> <lst name="params"> <str name="facet">true</str> <str name="indent">on</str> <str name="start">0</str> <str name="q">*:*</str> <arr name="facet.field"> <str>Instrument</str> <str>Location</str> </arr> <str name="facet.minCount">9</str> <str name="version">2.2</str> <str name="rows">0</str> </lst> </lst> <result name="response" numFound="188" start="0"/> <lst name="facet_counts"> <lst name="facet_queries"/> <lst name="facet_fields"> <lst name="Instrument"/> <lst name="Location"> <int name="Camden, New Jersey [unconfirmed]">118</int> <int name="Philadelphia, Pennsylvania [unconfirmed]">7</int> </lst> </lst> <lst name="facet_dates"/> </lst> </response>
As we can see from the response that Instrument facet which has zero number
of distinct values, is included in the response. Also facet "Philadelphia,
Pennsylvania [unconfirmed]" which has count less than mincount (9) is
included in the response.
The emptiness of Instrument field of the response shows that Solr
couldn't facet data (9 or above docs) on the field. Regarding Location
field, the result is weird. Can you show us the data and the
field type of the field to reproduce the problem?

I also tried Instrument.facet.mincount=1 but still I see Instrument facet in
the response.
Per field parameter needs "f." prefix. It should be f.Instrument.face.mincount=1.

Koji

--
http://www.rondhuit.com/en/

Reply via email to