Hi Tomasz,
You're right. The sort syntax that works in SQL doesn't work with Lucene. In Lucene syntax, you can specify a comma-delimited list of fields to sort by, with the optional "desc" modifier, like this:
annualfees, enrollmentfee desc
There are a couple of ways to achieve what you're looking for -- to have items with no ProjectCompletion date on top.
-
If you are already using custom code to build the index, it would be easy to add a custom Lucene document field, like HasProjectCompletionDate. Then you could sort by that before sorting by ProjectCompletion.
-
Another approach is to create a custom Lucene FieldComparator. It's more involved, but might be best if you are working with several such date fields. Here's a good discussion about it here:
Custom sorting of null values in Lucene.Net 3.0.3.
This sounds interesting. I'd love to hear how it goes.
Mike