If it works, it's performant and not too messy it's a good way :-) . You can also consider just faceting on Id, and use the id to fetch the categoryname through sql / nosql. That way your logic is seperated from your presentation, which makes extending (think internationalizing, etc.) easier. Not sure if that's appropriate for your 'category' field but anyway.
I belief you were asking this because you already had 2 multivalued fields: 'id' and 'category' which you wanted to reuse for this particular use-case. In short: you can't link a particular value in a multivalued field (e.g: 'id') to a particular value in another multivalued field (e.g: 'category'), so just give up this route, and go with what you had, or use the suggested above. hth, Geert-Jan 2011/3/11 Prav Buz <buz.p...@gmail.com> > Hi, > Thanks Erik, yes that's what I've done for now, but was wondering if it's > the best way :) > > thanks > > Praveen > > On Fri, Mar 11, 2011 at 6:06 PM, Erick Erickson <erickerick...@gmail.com > >wrote: > > > Thinking out loud here, but would it work to just have ugly > > categories? Instead of splitting them up, just encode them like > > 1|a > > 2|b > > 3|c > > > > or some such. Then split them back up again and display > > the name to the user and use the ID in the URL.... > > > > Best > > Erick > > > > On Fri, Mar 11, 2011 at 4:17 AM, Prav Buz <buz.p...@gmail.com> wrote: > > > Hi, > > > > > > Yes I already have different fields for category and category Id , and > > they > > > are in same order when retrieved from solr > > > > > > for eg: > > > IDs > > > 1 > > > 3 > > > 4 > > > 5 > > > names > > > a > > > b > > > c > > > d > > > e > > > > > > id 1 is of name a and id 5 is of name e. but when I sort the category > > names > > > , looses this order as they are not related in any manner in the solr > > docs. > > > > > > > > > Thanks > > > > > > Praveen > > > > > > On Fri, Mar 11, 2011 at 2:35 PM, Gora Mohanty <g...@mimirtech.com> > > wrote: > > > > > >> On Fri, Mar 11, 2011 at 2:32 PM, Prav Buz <buz.p...@gmail.com> wrote: > > >> [...] > > >> > I need to show a facets on Category and then I need the category id > in > > >> the > > >> > href link. For this what I 'm trying to do is create a field which > > will > > >> > store ID|Category in the schema and split it in the UI. > > >> > Also I have Category and category id 's indexed . > > >> [...] > > >> > > >> Why not have two different fields for category, and for category ID? > > >> > > >> Regards, > > >> Gora > > >> > > > > > >