0

I would like to know if the SQL Functions (DateAdd / DateDiff) are available on Azure Search. I could not find examples / docs about it, but they exist on ODATA official doc:

http://cdn.cdata.com/help/RDA/jdbc/pg_sqldatefunctions.htm

In case they are not available, what is the recommended way for date diffs as filters (e.g Age gt 18).

Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90

1 Answers1

1

Azure Search does not currently support OData date functions. You can model this particular problem in one of two ways: Either store time spans of a particular unit as integers (for example, age in years), or model everything as DateTimeOffset and just compare between them. For example: DateOfBirth lt 2000-07-03T00:00Z

Bruce Johnston
  • 8,344
  • 3
  • 32
  • 42
  • just a tip, please review the documentation and include which functions are not available / supported. – Thiago Custodio Jul 03 '18 at 16:53
  • Unsupported features of OData filters - Arithmetic expressions - Functions (except the distance and intersects geospatial functions) - any/all with arbitrary lambda expressions From: https://learn.microsoft.com/rest/api/searchservice/odata-expression-syntax-for-azure-search#bkmk_unsupported We'll be updating this article soon, so we'll look for ways to make this more obvious. – Bruce Johnston Jul 03 '18 at 21:25