Pravesh, Not exactly. Here is the search I do, in more details (different field name, but same issue).
I want to get a count for a specific value of the sou_codeMetier field, which is multivalued. I expressed this by including a fq clause : /select/?q=*:*&facet=true&facet.field=sou_codeMetier&fq=sou_codeMetier:1213206&rows=0 The response (excerpt only): <lst name="facet_fields"> <lst name="sou_codeMetier"> <int name="1213206">1281</int> <int name="1212104">476</int> <int name="121320603">285</int> <int name="1213101">260</int> <int name="121320602">208</int> <int name="121320605">171</int> <int name="1212201">152</int> ... As you see, I get back both the expected results and extra results I would expect to be filtered out by the fq clause. I can eliminate the extra results with a 'f.sou_codeMetier.facet.prefix=1213206' clause. But I wonder if Solr's behavior is correct and how the fq filtering works exactly. If I replace the facet.field clause with a facet.query clause, like this: /select/?q=*:*&facet=true&facet.query=sou_codeMetier:[1213206 TO 1213206]&rows=0 The results contain a single item: <lst name="facet_queries"> <int name="sou_codeMetier:[1213206 TO 1213206]">1281</int> </lst> The 'fq=sou_codeMetier:1213206' clause isn't necessary here and does not affect the results. Thanks, Alain On Fri, Oct 21, 2011 at 9:18 AM, pravesh <suyalprav...@yahoo.com> wrote: > Could u clarify on below: > >>When I make a search on facet.qua_code=1234567 ?? > > Are u trying to say, when u fire a fresh search for a facet item, like; > q=qua_code:1234567?? > > This this would fetch for documents where qua_code fields contains either > the terms 1234567 OR both terms (1234567 & 9384738.....and others terms). > This would be since its a multivalued field and hence if you see the facet, > then its shown for both the terms. > > >>If I reword the query as 'facet.query=qua_code:1234567 TO 1234567', I > only > get the expected counts > > You will get facet for documents which have term 1234567 only (facet.query > would apply to the facets,so as to which facet to be picked/shown) > > Regds > Pravesh > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/inconsistent-results-when-faceting-on-multivalued-field-tp3438991p3440128.html > Sent from the Solr - User mailing list archive at Nabble.com. >