tamaramata / solrnet

Automatically exported from code.google.com/p/solrnet
0 stars 0 forks source link

Created Query with Date range and nulls #184

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
    var x4 = new SolrQueryByRange<DateTime?>("Date", _clock.Now, null); 

This throws a NullReferenceException. Any other variation with null does not 
even compile. Same with DSL.Query("Date").From(date).To(null)

What would be the correct way to create an open-end date range?

Original issue reported on code.google.com by arafalov@gmail.com on 27 Jul 2012 at 6:47

GoogleCodeExporter commented 8 years ago
Oops. Ignore that. I had a bug in another part of the system that passed null 
in. However, this syntax above with DateTime? cast seem to be the only valid 
way to pass null into the range (which is meaningful for Dates).

It might be worth adding to the documentation as an example.

Original comment by arafalov@gmail.com on 27 Jul 2012 at 7:16

GoogleCodeExporter commented 8 years ago

Original comment by mauricio...@gmail.com on 28 Jul 2012 at 5:33