Probably you're not querying the field you think you are. Try adding &debug=all to the URL and I think you'll see something like
default_search_field:mm_state_code Which means you're searching for the literal phrase "mm_state_code" in your default search field (defined in solrconfig.xml for the handler you're using). You won't get any facets if you don't have any documents that match. Best Erick On Wed, May 22, 2013 at 7:42 AM, samabhiK <qed...@gmail.com> wrote: > Hello, > > I have a field defined in my schema.xml like so: > > <field name="sa_site_city" type="string" indexed="true" stored="true"/> > > string is a type : > > <fieldType name="string" class="solr.StrField" sortMissingLast="true" /> > > When I run the query for faceting data by the city: > > http://XX.XX.XX.XX/solr/collection1/select?q=mm_state_code&wt=json&indent=true&facet=true&facet.field=sa_site_city > > I get empty result like so: > > { > "responseHeader":{ > "status":0, > "QTime":1, > "params":{ > "facet":"true", > "indent":"true", > "q":"mm_state_code", > "facet.field":"sa_site_city", > "wt":"json"}}, > "response":{"numFound":0,"start":0,"docs":[] > }, > "facet_counts":{ > "facet_queries":{}, > "facet_fields":{ > "sa_site_city":[]}, > "facet_dates":{}, > "facet_ranges":{}}} > > I wonder what am I doing wrong? > > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Solr-Faceting-doesn-t-return-values-tp4065276.html > Sent from the Solr - User mailing list archive at Nabble.com.