You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Chris Lam <ch...@openrice.com> on 2018/05/10 04:44:39 UTC

Problem when using function query with group by field, rows=0 is not effect

Dear Solr,

I am using Solr 4.8.1 with 2 shard nodes on a collection
I have a query using the function query features and grouping

start=60&rows=0&fq=((expireTime:[NOW TO *] ) OR (*:* NOT expireTime:*))&q=_val_:"sum(mul(sub(1,div(div(sub(1525875131635,publishTime),86400000),180)),0.2),if(max(0,sub(redeemMethodId, 25)), 0.8, 0.4),product(sub(20,geodist(locLatLon,22.2918585,114.2081208)),0.025))"&fq=regionId:704&fl=couponId,poiId,distance:geodist(locLatLon,22.2918585,114.2081208)&wt=json&indent=true&facet=true&facet.field=catCuisineId&facet.field=catDishId&facet.field=catGroupId&facet.field=condition&facet.field=promotionId&facet.field=districtId&facet.field=landmarkId&facet.field=redeemMethodId&facet.field=tmPoiId&facet.limit=1000&facet.mincount=1&facet.sort=count&stats=true&stats.field=couponId&stats.calcdistinct=true&fq=&fq=&fq=&fq=&fq=((redeemMethodId:(27 26 34 ) AND couponId:(3459 3460 3461 3440 3425 3857 3849 3859 3860 3861 2409 2411 2550 2554 2558 2559 2560 3870 3867 3868 3869 3872 3873 3874 3876 3402 3405 3875 3347 3436 3396 3877 )) OR redeemMethodId:(33 ) OR redeemMethodId:(1 5 10 15 20 28 ))&sort=score desc&group=true&group.field=couponId&group.facet=true&group.ngroups=true

As you see, I have provided the rows=0 but it returns as many group as available
[cid:image001.jpg@01D3E85C.A8CC4170]

If I modify the query to rows=1 or remove the function query, the row taking is correct
(same query as above but rows=1)
[cid:image002.jpg@01D3E85C.A8CC4170]

Regards
Chris