Well I fixed my main problem. lucene can sort by index order, which makes life very simple. I now just store the key text as before. But I would be interested in why my code didn't work. Anyhow, cheers --Will