Search API search in date and time search

I am wondering how to have a millisecond from a datetime (e.g. 1362960734565), which I can easily find (e.g. all documents created after 1234560123456), or I need to implement some method to split the date or it is in a different format, so how it will not work like NUMBER or DATE.

According to the Google documentation for the search API ( https://developers.google.com/appengine/docs/java/search/overview#Describing_Data_with_Documents ):

Document Fields

Each document contains fields that will contain a specific type of content. The content type is identified by the field designer to set the type of field content as follows:

  • TEXT: plain text
  • HTML: HTML text
  • ATOM: a string that is treated as a single token
  • NUMBER: numeric value (floating or integer) between 2 147 483 647 and -2 147 473 647
  • DATE: date without time component
  • GEO_POINT: a locale based on latitude and longitude.
+4
source share
1 answer

My current solution:

With a timestamp as a DateTime, I store the date in a Date field type, and then get the milliseconds of the day and save it as Number.

Then I create a query for the search API using the numerical operators for these two fields, for example:

dayLastUpdated> = 2013-3-13 and timeLastUpdated> 82884753

+5
source

All Articles