0
votes

Can somebody give an example where Solr query gives the following count result of three fields (google, flickr, yahoo) - where the field value is true ?

google:20
flickr:10
yahoo:100

from the document like this:

{...., google:"123", flickr:"", yahoo:"8910", ....}

Thanks in advance.

Cs.

1

1 Answers

0
votes

You could probably use the Terms Component to do that.

https://wiki.apache.org/solr/TermsComponent

The output is a list of the terms and their document frequency values.

use qt=/terms to call the terms handler, and then specify terms.fl multiple times for each field type

terms.fl=google&terms.fl=flicker&terms.fl=yahoo

That should give you a count of the "true" term for each of the fields