|
@@ -13,15 +13,15 @@ const (
|
|
|
query_aggs_sortprice = `"sortprice_ranges": {"range":{"field":"sortprice","ranges":[%s]},"aggs":{"sum_sortprice":{"sum":{"field":"sortprice"}}}}`
|
|
|
aggs_area = `"area_distribution": {"terms": {"field": "area"},"aggs": {"area_amount": {"sum": {"field": "sortprice"}},"area_total": {"filter": {}}}}`
|
|
|
query_top10 = `,"sort": [{"sortprice": "desc"}],"from": 0,"size": 10`
|
|
|
- aggs_area_amounttop3 = `"area_amount_top3":{"terms":{"field":"area","order":[{"area_amount":"desc"}],"size":3},"aggs":{"area_amount":{"sum":{"field":"sortprice"}},"winner_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"area_winner_amount":"desc"}],"size":3},"aggs":{"area_winner_amount":{"sum":{"field":"sortprice"}}}}}}`
|
|
|
- aggs_area_counttop3 = `"area_count_top3":{"terms":{"field":"area","order":[{"area_count":"desc"}],"size":3},"aggs":{"area_count":{"filter":{}},"winner_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"area_winner_count":"desc"}],"size":3},"aggs":{"area_winner_count":{"filter":{}}}}}}`
|
|
|
+ aggs_area_amounttop3 = `"area_amount_top3":{"terms":{"field":"area","exclude":["全国"],"order":[{"area_amount":"desc"}],"size":3},"aggs":{"area_amount":{"sum":{"field":"sortprice"}},"winner_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"area_winner_amount":"desc"}],"size":3},"aggs":{"area_winner_amount":{"sum":{"field":"sortprice"}}}}}}`
|
|
|
+ aggs_area_counttop3 = `"area_count_top3":{"terms":{"field":"area","exclude":["全国"],"order":[{"area_count":"desc"}],"size":3},"aggs":{"area_count":{"filter":{}},"winner_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"area_winner_count":"desc"}],"size":3},"aggs":{"area_winner_count":{"filter":{}}}}}}`
|
|
|
aggs_buyerclass = `"buyerclass_scale":{"terms":{"field":"buyerclass","exclude":["其它",""]},"aggs":{"buyerclass_amount":{"sum":{"field":"sortprice"}},"buyerclass_total":{"filter":{}}}}`
|
|
|
aggs_buyerclass_counttop3 = `"buyerclass_count_top3":{"terms":{"field":"buyerclass","exclude":["其它",""],"order":[{"buyerclass_count":"desc"}],"size":3},"aggs":{"buyerclass_count":{"filter":{}},"bidcount_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"buyer_winner_count":"desc"}],"size":3},"aggs":{"buyer_winner_count":{"filter":{}}}}}}`
|
|
|
aggs_buyerclass_amounttop3 = `"buyerclass_amount_top3":{"terms":{"field":"buyerclass","exclude":["其它",""],"order":[{"buyerclass_amount":"desc"}],"size":3},"aggs":{"buyerclass_amount":{"sum":{"field":"sortprice"}},"winner_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"buyer_winner_amount":"desc"}],"size":3},"aggs":{"buyer_winner_amount":{"sum":{"field":"sortprice"}}}}}}`
|
|
|
sortprice_str = `{"key":"<10万","from":0.0000000000001,"to":100000},{"key":"10万-50万","from":100000,"to":500000},{"key":"50万-100万","from":500000,"to":1000000},{"key":"100万-500万","from":1000000,"to":5000000},{"key":"500万-1000万","from":5000000,"to":10000000},{"key":"1000万-1亿","from":10000000,"to":100000000},{"key":"≥1亿","from":100000000}`
|
|
|
aggs_all_c_m = `"project_count": {"filter": {}},"project_count_not0": {"filter": {"range": {"sortprice": {"gt": 0}}}},"project_amount": {"sum": {"field": "sortprice"}}`
|
|
|
- query_id = `{"query": {"bool": {"must": [{"term": {"entidlist": "%s"}}]}},"_source":["_id","company_name"],"size": 1}`
|
|
|
- query_idto = `{"query": {"bool": {"must": [{"terms": {"qyxy.id": ["%s"]}}]}},"size": %d}`
|
|
|
+ query_id = `{"query": {"bool": {"must": [{"term": {"entidlist": "%s"}}]}},"size": 1}`
|
|
|
+ query_idto = `{"query": {"bool": {"must": [{"terms": {"qyxy.id": ["%s"]}}]}},"_source":["_id","company_name"],"size": %d}`
|
|
|
)
|
|
|
|
|
|
type AreaCTop struct {
|