solr 回到的json数据

solr 返回的json数据看图json为solr 返回的json数据以下代码都是在js中操作a.var property1Value json.f

solr 返回的json数据

看图solr 回到的json数据

json为solr 返回的json数据

以下代码都是在js中操作

a.  var property1Value = json.facet_counts.facet_fields["property1"];    这里传入的是字符串property1  因而要用双引号,也可以传入property1 property2 property3 property4 property5 和type 这个6个都是facet.field 字段

b.  var property1Value =  json.facet_counts.facet_fields.property1;   这里的property1是对象不再是字符串

a和b两种方式等价

var property1Value  的值 为  solr 回到的json数据


solr 回到的json数据solr 回到的json数据


facet.field=price  也会统计 facet字段按照 price 有多少个
facet.query=price:[100000 TO *] 统计该范围多少个  其中price 为facet字段