Thanks, I will try that though I am talking in my case about 100,000+ distinct surnames/towns maximum per query and I just needed the count and not the whole list. In any case, this brute-force approach is still something I can try but I wonder how this will behave speed and memory wise when there are many different concurrent queries and so on...
Cheers, Bruno 2009/2/4 Shalin Shekhar Mangar <shalinman...@gmail.com> > On Wed, Feb 4, 2009 at 2:53 PM, Bruno Aranda <brunoara...@gmail.com> > wrote: > > > Mmh, thanks for your answer but with that I get the count of names > starting > > with A*, but I would like to get the count of distinct surnames (or town > > names, or any other field that is not the name...) for the people with > name > > starting with A*. Is that possible? > > > > It is possible. You can use fq=name:A* to filter people whose names start > with 'A'. Then you can use facet.field=surnames or facet.field=town or > whatever you want with facet.limit=-1 and count the number of results for > each facet. It may be slow for the first query but it is cached so > subsequent queries should be faster (make sure you size filterCache > appropriately). > > -- > Regards, > Shalin Shekhar Mangar. >