Sorting documents in lucene

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Sorting documents in lucene

Hugo <Nabble>
Administrator
Lucene doesn't seem to sort documents anymore. You can try the Web_search page with a sample database. I will send a sample database to you via skype.
Reply | Threaded
Open this post in threaded view
|

Re: Sorting documents in lucene

fschmidt
Administrator
fixed in rev 1b2e4c7dab85.  But sorting user_when_created still won't work because it is stored as a long.  You need to store it as an unanalyzed string.  Then you can sort that string as a long.  Not intuitive, I realize.  I guess we will need to write a Lucene tutorial.
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: Sorting documents in lucene

Hugo <Nabble>
Administrator
fschmidt wrote
But sorting user_when_created still won't work because it is stored as a long.
Are you sure about that? It is working fine for me. You can try these queries in the Web_search page:
sort{{field='user_when_created', type='long'}}
sort{{field='user_when_created', type='long', reverse=true}}
Reply | Threaded
Open this post in threaded view
|

Re: Sorting documents in lucene

fschmidt
Administrator
Yes it works.  I had a typo.
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: Sorting documents in lucene

Hugo <Nabble>
Administrator
Okay, thanks. Closing thread.