Question

I am using SOLR and i have a schema something Like this :

<fields>
<field name="Id" type="string" indexed="true" stored="true" required="true" multiValued="false" /> 
   <field name="Username" type="text_general" indexed="true" stored="true" omitNorms="true" multiValued="false"/>
 <field name="ServerName" type="text_general" indexed="true" stored="true" multiValued="false" />
<fields/>

I want to use facet to get the result that give me the number of user per each server how can i do that?

desired result :

server 1 : 200 (userNumber)
server 2: 300
and so on...

thank you

Was it helpful?

Solution

This is not a complete solution, as i do not have your data and schema. But what i think you need is pivot Faceting http://wiki.apache.org/solr/SimpleFacetParameters#Pivot_.28ie_Decision_Tree.29_Faceting .

So you need to do something like this (again , you need to adjust this to make it work for you)

http://ip:port/solr/collection1/select?q=*:*&rows=0&facet=true&facet.pivot=Username,ServerName
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top