Hi Teun, In the past I've done this by creating a separate field that contains just the first letter of the original field, and faceting on that. So say you've got a 'colour' field with contents [red, yellow, blue], then you'd add a 'colourPrefix' field with contents [r, y, b] and facet/filter on that.
Alan Woodward www.flax.co.uk On 27 Feb 2013, at 07:01, Teun Duynstee wrote: > What I really miss in the SimpleFaceting component is the ability to get > facets not of the full term, but grouped by the first letter(s). I wrote a > Jira issue on this ( https://issues.apache.org/jira/browse/SOLR-4496). I > also wrote a patch with a rather simplistic first try of an implementation. > > Now that I've had a better look at faceting multi valued fields and the > inner working of UninvertedField, I see that doing it right is harder than > I thought, but I'd still like to give it a try. > > So can anyone give me some tips on how to approach this? Should I treat the > facet on the first letters as a completely independent field? Should I > build the index based on the index of the complete field? By the nature of > this kind of facet, you'll always have a fairly limited number of terms. > > Thanks a lot, > Teun