I need to achieve a query where RefinableDate00 must be earlier than today


but also should not be null since if it is null, the result I want does not appear in the search. RefinableDate00 has mapped property that is a custom column and the column doesn't exists in some lists so the value return null I believe ANDNOT operator is what I need or it would be good if we can create something like if condition

(contentclass:STS_List OR contentclass:STS_List_DocumentLibrary OR contentclass:STS_List_PictureLibrary) {SearchBoxQuery} AND (-RefinableDate00:1900-01-01..{Today}) AND (RefinableString00=True)

I expect results earlier than today, and results that RefinableDate00 might be equal

  • it would be helpful if you provide a sample input table using the datatable operator and the expected output.
    – rony l
    Sep 15 '21 at 16:14
  • I am pretty noob here, but I added my query, I only want results earlier than today but since not all lists have that date field, items don't have that column don't return
    – Ozan Mudul
    Sep 15 '21 at 16:19

Maybe you mean this operator: <>

  • Isn't this not equal operator?
    – Ozan Mudul
    Sep 17 '21 at 10:50
  • I think Yes. <> - Returns search results where the property value does not equal the value specified in the property restriction. github.com/SharePoint/sp-dev-docs/blob/master/docs/… Sep 20 '21 at 8:14
  • 1
    Though it doesn't work if the value is null. I made a workaround like this: -RefinableDate00:{Today}..3000-12-12, this means if not in between today and 3000 so I can show null values and days before today. Still if you have better solutions I would like to hear cuz this looks brute force
    – Ozan Mudul
    Sep 20 '21 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.