
Using SQL you can use operators such as IsNull to return items which are missing a value, but using SharePoint search you don’t have this operator.
A common work around is to provide some dummy/default value, and you can filter on this one instead. But often this is not an option.
Previously in my post KQL – The Basics I showed how to return all items which don’t have a value set on a taxonomy column, where you do a negative filtering on the term set GUID.
-owstaxIdLocation:"GTSet|#fc01ae6d-8ed3-4872-9cef-d2199d52d61c"
And the negation is the clue as to how you can achieve searching for items missing a value. If you know all possible values, or some part which all items which have the value set contain, then you can negate.
The current solution I was working on had a list of items with an optional start and end date. I wanted to return all items within the start and end dates as well as those with no dates set.
First of all, in order to filter on dates you have to map the crawled property for your columns to managed properties of type Date, for example RefinableDateXX.
In my list I have two site columns, StartDate and EndDate, with the corresponding crawled properties ows_StartDate and ows_EndDate. I map each of these to RefinableDate00 and RefinableDate01.
The query to limit items between these two dates is pretty straight forward:
RefinableDate00<=today AND RefinableDate01>=today
[Update 2014-12-11]
In order to also return values which don't have those dates set I switch the query around to
NOT(RefinableDate00>today) NOT(RefinableDate01<today)
Doing the negation will not only match on dates outside the start/end range, but also include empty values.
Summary
Using the above queries you can now, without any custom coding, return items which are missing either taxonomy or date values.