We have requirement where there are three fields user date, recorded date and encoded date. We use Solr for searching and we have requirement to retrieve records using condition if value exists for user date use it else check for recorded date and if it also doesn't contain value use encoded date and if all three fields contains no value ignore that field.
This requirement is similar to COALESCE functionality in oracle where It accepts two or more parameters and returns the first non-null value in a list. If all parameters contain null values, it returns null.
Update :: We are using Solr 3.5.0
For example below is my values in table
DocumentID User entered date Recorded date Encoded date
A123 14th April 2016 12th April 2016
A124 12th April 2016 11th April 2016
A125 13th April 2016 12th April 2016
A126 12th April 2016
A127 15th April 2016
If we search for April 12th 2016 then Solr should return me output as A124, A126 and not A123 or A125 because we have user entered date and recorded date for those fields respectively.