2013-08-28 69 views
3

鮮明結果我已經Solr的索引的數據如下面從Solr的查詢

<doc> 
    <str name="pincode">792056</str> 
    <str name="city">Bijoypur-I Bl.I -III</str> 
    <str name="district">Changlang</str> 
    <str name="locality">Bijoypur-I Bl.I -III</str> 
    <str name="state">Arunachal Pradesh</str> 
</doc> 

我的問題是從相同的狀態10個不同pincodes我有10個文件,當我查詢使用查詢http://ip:port/solr/select?q=state:Arunachal Pradesh 狀態它返回10個值具有相同狀態的名字,但我需要國家名稱的不同值而已,請幫我在這

回答

4

是一個小的查詢WH在你之後?這應該爲您提供每個州的文檔數量狀態列表:

http://ip:port/solr/select?q=*:*&rows=0&facet=true&facet.limit=-1&facet.field=state 

也許準確地描述了期望的結果。

+0

感謝您的答覆,我試過它的工作方面,但實際上我需要的是分組 – Siva