Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz
authorDennis Schafroth <dennis@indexdata.com>
Thu, 9 Sep 2010 15:37:58 +0000 (17:37 +0200)
committerDennis Schafroth <dennis@indexdata.com>
Thu, 9 Sep 2010 15:37:58 +0000 (17:37 +0200)
1  2 
src/solr.c

diff --combined src/solr.c
@@@ -257,7 -257,7 +257,7 @@@ int yaz_solr_decode_response(ODR o, Z_H
                          rc_result = yaz_solr_decode_result(o, ptr, sr);
                  /* TODO The check on hits is a work-around to avoid garbled facets on zero results from the SOLR server.
                   * The work-around works because the results is before the facets in the xml. */
 -                if (rc_result == 0 && match_xml_node_attribute(ptr, "lst", "name", "facet_counts"))
 +                if (rc_result == 0 &&  *sr->numberOfRecords > 0 && match_xml_node_attribute(ptr, "lst", "name", "facet_counts"))
                      rc_facets =  yaz_solr_decode_facet_counts(o, ptr, sr);
              }
              ret = rc_result + rc_facets;
@@@ -356,6 -356,7 +356,7 @@@ int yaz_solr_encode_request(Z_HTTP_Requ
              Z_FacetList *facet_list = request->facetList;
              int limit = 0;
              yaz_add_name_value_str(encode, name, value, &i, "facet", "true");
+             yaz_add_name_value_str(encode, name, value, &i, "facet.mincount", "1");
              yaz_solr_encode_facet_list(encode, name, value, &i, facet_list, &limit);
              /*
              olimit = limit;