Assuming that there aren't too many of these, you can use facet.query=field:banana&facet.query=field:oranges etc, repeated as many times as you need.
This gets pretty awkward if you have more than a dozen or so facets, but you might be able to get some mileage out of defining these as defaults in your requestHandler. Alternatively, you could probably do something with a custom search component that gleaned some of this info out of the underlying Lucene index using some of the Lucene APIs. Best Erick On Tue, Nov 8, 2011 at 5:41 PM, kingkong <jasonmeyer...@yahoo.com> wrote: > I'm a newbie with Solr. Is there a way to create document counts for a list > of keywords without using a facet field? For example, say I have a fruit > related web site and want to list on the main page the top fruits; apples > (23), oranges (14), pears (5), etc. > > The fruits are the "keywords" that are of interest at the moment. However, > say I begin adding documents with other keywords of interest, for example, > "bananas". > > Using a facet field, I would need to go back and re-index all the old > documents to see if any of them contain the term "banana" in order to get > accurate counts. > > Is it possible to have an Analyzer, Tokenize or Token Filter automatically > re-index as new keywords are added to a list and create the correct counts? > If so, how would I do it? > > My goal is to have a keyword list, which may be updated from time to time, > and display the counts for each on the main page (without having to manually > re-index old documents). > > Thank you. > Jason > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Keyword-counts-tp3491955p3491955.html > Sent from the Solr - User mailing list archive at Nabble.com. >