0
votes

I have a requirement to facet my data over two fields in Apache Solr.

The fields in my loginhistory schema are user_id, city, status, time. I want to find out the number of users logged in from a particular city and for a particular status in a given time frame.

For example, output of my query should show the following:

City Status Count
NY SUCCESS 43 NY FAILURE 10 NY INP 32 LA SUCCESS 65 LA FAILURE 12 ..............

Here is the sample query that facet over city field for a given time frame.

http://localhost:8983/solr/query?q=status:SUCCESS%20AND%20time:2015-12-20T16:13:00Z+TO+2015-12-20T16:13:20Z&facet=true&facet.field=city

1

1 Answers

1
votes

You might want to take a look at Solr pivot faceting:

Solr faceting + pivot faceting