: I have an index with a field called 'category'. The data is not clean, : so documents may have values such as 'ABC DEF', 'abc-def', 'ABC-def' : etc. Now, I want to facet by this field and want all such values to be : clubbed together.
: I created a field called 'category_facet' where I strip everything : except alphabets and then lower case the whole thing. That works fine : for getting the facets and counts, but the facet names returned ('abc : def' in this case) cannot be displayed directly. I need to get the : stored value of the field (any one will do). The only way I can think The Simple Faceting code provided with Solr is just that -- simple. If you want different labels for each of the filter values you have to get creative ... in my request handlers i use numeric codes for all my filter values, and pull the labels from seperate data stores (i actual use instance of the SolrCache to access this data, so i can automaticly update the labels anytime i push out a new snapshot). : of is to fire another query with "category_facet=abc def" and : "numRows=1" to get a single result and then get the stored value of the : category field. that approach will work ... if i were in your shoes though, and i was munging all of the indexed terms to be consistent and uniform, i would just munge them to be consistent and uniform *and* pretty too (there's a CapitalizationFilterFactory specificly for this purpose) -Hoss