Facet.Fields is returning zero records always

11 views
Skip to first unread message

mjge...@gmail.com

unread,
Nov 29, 2016, 8:51:59 AM11/29/16
to SolrNet
This code is retuning zero records for facets. Not sure what is my mistake.

My schema for Id column is 

    <field name="Id" type="int" indexed="true" stored="true" required="true" multiValued="false"/>

C# code:   

SolrQueryResults<T> r = solrInstance.Query(SolrQuery.All, new QueryOptions
            {

            Facet = new FacetParameters
            {
               Queries = new[] { new SolrFacetFieldQuery("Id")}
            },
            Rows = 10,
            Start = 1

            });

            foreach (var facet in r.FacetFields["Id"])
            {
                distinctList.Add(new KeyValuePair<string, int>(facet.Key, facet.Value));
            }

If i try to facet on "text_general" datatype, I'm still getting the same issue. I'm using SolrNet 4.0 and Solr version is 5.4.0
Reply all
Reply to author
Forward
0 new messages