Phonix
Phonix

Reputation: 2217

Lucence .NET sort by DateTime

I use Lucene.Net.Linq to index data.Lucene.Net.Linq save datetime like "2015-01-03T09:47:59".

Now how I can sort index using raw Lucence .NET? I test this but it`s not working :

 var sort = new Sort(new SortField("DateTime", SortField.LONG, false));

For your information filtering work with this code :

var dateFilter = new Lucene.Net.Search.TermRangeFilter("DateTime", startDate.ToString("s"),endDate.ToString("s"), true, true);

Upvotes: 0

Views: 163

Answers (0)

Related Questions