tjake/Solandra — Issue #155: Repeatable steps to highlight sort issue
Author: jkusar
Created: 2011-12-03 19:44:26+00:00
State: open

So I can confirm that there is most definitely an issue with sorting on strings (seems to work ok with dates). Here's what I did:

1) Install Cassandra and Solandra
2) run the scripts to load the Reuters test data
3) Run a basic search: http://localhost:8983/solandra/reuters/select?q=national&wt=xml&sort=id%20asc

id is stored as a string, so it should be sorted in lexicographical order. The first document is always right, but the others randomly shift around as you refresh the page.

The part that confuses me most currently is that if you switch the order to "id desc" it works perfectly every time. There is something with the sorting that only affects ascending sorts. As mentioned previously, everything works just fine for dates, so I'm leaning towards possibly a problem with the field cache for strings, but I haven't been able to find anything yet. I'm admittedly far from an expert on Lucene and I'm not entirely clear on which parts are being handled with Solandra and which with normal lucene. I'll keep looking at it, but if someone more familiar with the internals could take a look, that would be amazing.

Thanks!
Jason