tantivy icon indicating copy to clipboard operation
tantivy copied to clipboard

Add precision to datetime field and datetime field internally expressed in microsecs.

Open fulmicoton opened this issue 3 years ago • 0 comments

In order to have a better DateTime support , In Tantivy, we need to implement:

  • Update the current DateTime type to hold unix-timestamp in microseconds
  • The input parsing with support only for rfc3339 format.
  • The query parsing with support only for rfc3339 format.
  • DateTime fields will be output in unix-timestamp microsecond, This helps Tantivy users format the value in whatever format for display.
  • Assume all DateTime received to be in UTC if not explicitly specified in the format

The DateTime field schema spec needs precision.

  • FastField: We will internally store all dates in i64 using the unix-timestamp microseconds value. The precision option will be used to store what’s exactly needed in fast fields. As of now, we won’t support nanosecond precision.
  • In docStore: We store the timestamp as i64 representing the unix-timestamp value in microseconds of the parsed input without any precision knowledge.

fulmicoton avatar Jul 06 '22 03:07 fulmicoton