Sunday, March 22, 2009

solr and locale sensitive sort

Another of those meaningless exercises:
We've been using solr on our project for quite a bit now and have been quite pleased with it, everything went great till we had to support character based language (Chinese to be more specific). Based on my research, I decided to use CJKAnalyzer for analyzing and tokenizing and the results returned were generally acceptable, the only issue being the results were not sorted in any rather random order if I asked solr to sort results alphabetically. After couple of hours of hunting solr user groups and looking at the solr source, I realized that solr does'nt provide any support for locale sensitive sorting. Since finding out the problem is half the problem already solved, all I had to do was extend from solr's built-in StrField; add support for another attribute (locale) in schema.xml and pass that to new instance of SortField and voila, solr was happily returning the results sorted by pinyin. In case you are interested, below is the discussion around the problem and the JIRA issue for solr (which has the new locale sensitive custom java class):

do we need guitars?

I was just reading the "starting over" post on Mars Need Guitars, a blog I used to follow earlier to check out music before it disappeared into oblivion. It's funny what depression can do to you, it can slowly eat away all that is inside of you and even before you know what hit you, you are already spiritually dead. A lot of things in that post reminded me of myself, someone who too is trying to get past every day; and (luckily) somehow succeeding at it. I just wish I could start afresh and do things that I want to do: write some short stories, write the book that always I wished to write, get away from this meaningless stuff and just break free. Maybe, one of these days, I will.

Sunday, March 08, 2009


A new year and same day to look back at life and think about where I am. Over the past few years a couple of questions have haunted me:

1) Where am I?
I don't think I know where I am in terms of my mental & emotional state; the scary thing is that I don't even care any longer.

2) Am I happy doing what I am doing?
No, I am not happy doing what I am doing either professionally or personally. Life has just been meandering along all these years. Earlier, I would get all worked up and try to change things that I wouldn't like but off-late it's more of sorta resigning to the facts...I don't even feel like doing anything to change my life and/or its course.

3) Do I know what I want?
Everyone will tell you that they are not getting what they want, the trouble is very few of us are even aware of what we really want. I have no guilt in admitting that I don't know what I want in my life. I can tell for sure what I DON'T want, but I don't know what will make me happy, any longer. It's just that sometimes, I feel like running away; don't know what I want to run away from, perhaps myself.

4) Have I changed over these years?
Yes, I have and quite a bit. I don't feel that strongly about anything. I used to fight for what I felt was right; I don't now. I have no problems in doing what others want me to do cause I don't feel strongly for or against anything. I believe feelings are strongly connected with your emotions and since I spent so many emotions over these years; it looks like my emotions have run out. I just go through the motions now; don't want to change anything or more rightly put; don't have any strength and motivation to change anything. Why shall I change something which doesn't matter to me, anyway?

5) Do I deserve more?
I don't know, anyway it doesn't matter what I think. My life has always been dictated by what others wanted in their life; perhaps I've let people come too close to me and yes, if I get a second chance I would still do the same thing over & over again without event a second thought.