i'm new to solr search.I want to get disinct values of fields using solr.
I'm using &rows=0&facet=on&facet.field=fieldname&wt=json
Output:
facet_fields":{"packagename":["bangalore",2,"hyerabadd",2,"australia",3]
This is my code for decode above output:
<?php
header("Content-type:text/json");
$data=file_get_contents("http://localhost:8984/solr/collection1/select?q=*:*&rows=0&facet=on&facet.field=fieldname&wt=json");
$res=json_decode($data);
foreach($res->facet_counts->facet_fields as $doc){
foreach($doc as $value){
echo $value;
}
}
?>
Output after decode:
bangalore
2
hyderabad
2
australia
3
but,here i dont't want to display those numbers(min count).