Open xumix opened 9 years ago
The expression that causes this error looks like this:
((LuceneField(ChildFromAge) != null) == False)
As a work around to using HasValue
which is currently not recognized, you might have some luck using == null
, as in:
query = query.Where(q => (q.ChildFromAge == null || q.ChildFromAge <= bdates.Min()) && (q.ChildToAge == null || q.ChildToAge <= bdates.Max()));
Alternatively, your data model could be altered to default ChildFromAge to zero and ChildFromAge to 200 (for example). This would likely result in better query execution performance since the less-than and greater-than expressions would be reduced to a Numeric Range Query.
Thanks for the tip! I'll use it.
The query looks like:
So I want items where there are no limitsor the limits are in range. The error looks like this: