我是solr查询中的新手(solr 4.0),我想在两个表之间进行连接,同时我想应用一个方面:我的查询是这样的:
http://solr-master/collection1/select?fq={!join+from=id+to=project_id_s}
id:*&q=[*+TO+*]&fq=nature_s=EQPX&stats=on&stats.field=nbPublication_i
&stats.field=budget_i&stats.facet=region_s&wt=json&indent=true
这个结果只显示了包含'project_id_s'字段的最后一个表的字段: 如果我可以用sql来表达我的需要,那么我想在solr中执行这个查询:
Select sum(myfield1),sum(myfield2),sum(myfield3)
FROM Table& as T1, Table2 as T2
WHERE T1.id=T2.project_id_s AND T1.field='condition1' AND T2.field='condition2'
Group BY T1.field or Group BY T2.field