I am unsure that how I can use it with sorting. I want to sort the result by datetime descending.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
UPDATE (2013.04.22): Newer versions of Lucene.NET allow sorting by DateTime more directly, for example:
Add the CreationTime as DateTime.Ticks to allow searching for it via SortField.LONG.
I have tested this with version 3.0.
yes, this question has partly been answered before. However, I would like to add a note on the DateTime part.
In regular Lucene communities it is offen recommended to split up DateTime’s in order to make them performant and/or precise enough (Int32 is just 10 characters). I’ve benchmarked with up to 500.000 documents half a year ago, and as I remember, this really was the only performant way I could come up with.
Anyway, you can try out something like this:
Indexing
Searching