On 7 March 2014 15:18, Salman Akram <salman.ak...@northbaysolutions.net> wrote: > All, > > Is it possible to get partial counts in SOLR? The idea is to get the count > but if its above a certain limit than just return that limit. > > Reason: In an index with millions of documents I don't want to know that a > certain query matched 1 million docs (of course it will take time to > calculate that). Why don't just stop looking for more results lets say > after it finds 100 docs? Possible?? > > e.g. Something similar that we can do in MySQL: > > SELECT COUNT(*) FROM ( (SELECT * FROM table where 1 = 1) LIMIT 100) Alias
The response to the /select Solr URL has a "numFound" attribute that is the number of matches. Regards, Gora