[ 
https://issues.apache.org/jira/browse/CONNECTORS-1275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15143849#comment-15143849
 ] 

Karl Wright commented on CONNECTORS-1275:
-----------------------------------------

The ElasticSearch docs say the following (from 
https://www.elastic.co/guide/en/elasticsearch/reference/2.0/mapping-date-format.html)

{quote}
Most of the below dates have a strict companion dates, which means, that year, 
month and day parts of the week must have prepending zeros in order to be 
valid. This means, that a date like 5/11/1 would not be valid, but you would 
need to specify the full date, which would be 2005/11/01 in this example. So 
instead of date_optional_time you would need to specify 
strict_date_optional_time.

The following tables lists all the defaults ISO formats supported:

epoch_millis
A formatter for the number of milliseconds since the epoch. Note, that this 
timestamp allows a max length of 13 chars, so dates older than 1653 and 2286 
are not supported. You should use a different date formatter in that case.
epoch_second
A formatter for the number of seconds since the epoch. Note, that this 
timestamp allows a max length of 10 chars, so dates older than 1653 and 2286 
are not supported. You should use a different date formatter in that case.
date_optional_time or strict_date_optional_time
A generic ISO datetime parser where the date is mandatory and the time is 
optional. Full details here.
basic_date
A basic formatter for a full date as four digit year, two digit month of year, 
and two digit day of month: yyyyMMdd.
basic_date_time
A basic formatter that combines a basic date and time, separated by a T: 
yyyyMMdd'T'HHmmss.SSSZ.
basic_date_time_no_millis
A basic formatter that combines a basic date and time without millis, separated 
by a T: yyyyMMdd'T'HHmmssZ.
basic_ordinal_date
A formatter for a full ordinal date, using a four digit year and three digit 
dayOfYear: yyyyDDD.
basic_ordinal_date_time
A formatter for a full ordinal date and time, using a four digit year and three 
digit dayOfYear: yyyyDDD'T'HHmmss.SSSZ.
basic_ordinal_date_time_no_millis
A formatter for a full ordinal date and time without millis, using a four digit 
year and three digit dayOfYear: yyyyDDD'T'HHmmssZ.
basic_time
A basic formatter for a two digit hour of day, two digit minute of hour, two 
digit second of minute, three digit millis, and time zone offset: HHmmss.SSSZ.
basic_time_no_millis
A basic formatter for a two digit hour of day, two digit minute of hour, two 
digit second of minute, and time zone offset: HHmmssZ.
basic_t_time
A basic formatter for a two digit hour of day, two digit minute of hour, two 
digit second of minute, three digit millis, and time zone off set prefixed by 
T: 'T'HHmmss.SSSZ.
basic_t_time_no_millis
A basic formatter for a two digit hour of day, two digit minute of hour, two 
digit second of minute, and time zone offset prefixed by T: 'T'HHmmssZ.
basic_week_date or strict_basic_week_date
A basic formatter for a full date as four digit weekyear, two digit week of 
weekyear, and one digit day of week: xxxx'W'wwe.
basic_week_date_time or strict_basic_week_date_time
A basic formatter that combines a basic weekyear date and time, separated by a 
T: xxxx'W'wwe'T'HHmmss.SSSZ.
basic_week_date_time_no_millis or strict_basic_week_date_time_no_millis
A basic formatter that combines a basic weekyear date and time without millis, 
separated by a T: xxxx'W'wwe'T'HHmmssZ.
date or strict_date
A formatter for a full date as four digit year, two digit month of year, and 
two digit day of month: yyyy-MM-dd.
date_hour or strict_date_hour
A formatter that combines a full date and two digit hour of day.
date_hour_minute or strict_date_hour_minute
A formatter that combines a full date, two digit hour of day, and two digit 
minute of hour.
date_hour_minute_second or strict_date_hour_minute_second
A formatter that combines a full date, two digit hour of day, two digit minute 
of hour, and two digit second of minute.
date_hour_minute_second_fraction or strict_date_hour_minute_second_fraction
A formatter that combines a full date, two digit hour of day, two digit minute 
of hour, two digit second of minute, and three digit fraction of second: 
yyyy-MM-dd'T'HH:mm:ss.SSS.
date_hour_minute_second_millis or strict_date_hour_minute_second_millis
A formatter that combines a full date, two digit hour of day, two digit minute 
of hour, two digit second of minute, and three digit fraction of second: 
yyyy-MM-dd'T'HH:mm:ss.SSS.
date_time or strict_date_time
A formatter that combines a full date and time, separated by a T: yyyy- 
MM-dd'T'HH:mm:ss.SSSZZ.
date_time_no_millis or strict_date_time_no_millis
A formatter that combines a full date and time without millis, separated by a 
T: yyyy-MM-dd'T'HH:mm:ssZZ.
hour or strict_hour
A formatter for a two digit hour of day.
hour_minute or strict_hour_minute
A formatter for a two digit hour of day and two digit minute of hour.
hour_minute_second or strict_hour_minute_second
A formatter for a two digit hour of day, two digit minute of hour, and two 
digit second of minute.
hour_minute_second_fraction or strict_hour_minute_second_fraction
A formatter for a two digit hour of day, two digit minute of hour, two digit 
second of minute, and three digit fraction of second: HH:mm:ss.SSS.
hour_minute_second_millis or strict_hour_minute_second_millis
A formatter for a two digit hour of day, two digit minute of hour, two digit 
second of minute, and three digit fraction of second: HH:mm:ss.SSS.
ordinal_date or strict_ordinal_date
A formatter for a full ordinal date, using a four digit year and three digit 
dayOfYear: yyyy-DDD.
ordinal_date_time or strict_ordinal_date_time
A formatter for a full ordinal date and time, using a four digit year and three 
digit dayOfYear: yyyy-DDD'T'HH:mm:ss.SSSZZ.
ordinal_date_time_no_millis or strict_ordinal_date_time_no_millis
A formatter for a full ordinal date and time without millis, using a four digit 
year and three digit dayOfYear: yyyy-DDD'T'HH:mm:ssZZ.
time or strict_time
A formatter for a two digit hour of day, two digit minute of hour, two digit 
second of minute, three digit fraction of second, and time zone offset: 
HH:mm:ss.SSSZZ.
time_no_millis or strict_time_no_millis
A formatter for a two digit hour of day, two digit minute of hour, two digit 
second of minute, and time zone offset: HH:mm:ssZZ.
t_time or strict_t_time
A formatter for a two digit hour of day, two digit minute of hour, two digit 
second of minute, three digit fraction of second, and time zone offset prefixed 
by T: 'T'HH:mm:ss.SSSZZ.
t_time_no_millis or strict_t_time_no_millis
A formatter for a two digit hour of day, two digit minute of hour, two digit 
second of minute, and time zone offset prefixed by T: 'T'HH:mm:ssZZ.
week_date or strict_week_date
A formatter for a full date as four digit weekyear, two digit week of weekyear, 
and one digit day of week: xxxx-'W'ww-e.
week_date_time or strict_week_date_time
A formatter that combines a full weekyear date and time, separated by a T: 
xxxx-'W'ww-e'T'HH:mm:ss.SSSZZ.
week_date_time_no_millis or strict_week_date_time_no_millis
A formatter that combines a full weekyear date and time without millis, 
separated by a T: xxxx-'W'ww-e'T'HH:mm:ssZZ.
weekyear or strict_weekyear
A formatter for a four digit weekyear.
weekyear_week or strict_weekyear_week
A formatter for a four digit weekyear and two digit week of weekyear.
weekyear_week_day or strict_weekyear_week_day
A formatter for a four digit weekyear, two digit week of weekyear, and one 
digit day of week.
year or strict_year
A formatter for a four digit year.
year_month or strict_year_month
A formatter for a four digit year and two digit month of year.
year_month_day or strict_year_month_day
A formatter for a four digit year, two digit month of year, and two digit day 
of month.
{quote}

What is not clear is how to specify what format?  The date will appear in the 
json as a string, but doesn't tell me how to signal to ES what format to 
expect.  Or maybe it just figures it out itself?

The format I'd naturally want to use would be this one:

{quote}
basic_date_time
A basic formatter that combines a basic date and time, separated by a T: 
yyyyMMdd'T'HHmmss.SSSZ.
{quote}




> ES connector doesn't deal with dates properly
> ---------------------------------------------
>
>                 Key: CONNECTORS-1275
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-1275
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: Elastic Search connector
>    Affects Versions: ManifoldCF 2.3
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>             Fix For: ManifoldCF 2.4
>
>
> The ES connector does not fill in JSON dates in the proper format.  For 
> example:
> {code}
> {
>   "took": 4,
>   "timed_out": false,
>   "_shards": {
>     "total": 6,
>     "successful": 6,
>     "failed": 0
>   },
>   "hits": {
>     "total": 1,
>     "max_score": 0.15342641,
>     "hits": [
>       {
>         "_index": "index",
>         "_type": "sharepoint",
>         "_id": "http://sample.net/Lists/mylist/DispForm.aspx?ID=1";,
>         "_score": 0.15342641,
>         "_source": {
>           "Modified": "2016-02-09 12:35:56", // <--- Wrong type, should be 
> Date
>           "App Created By": "",
>           "GUID": "{D233EA70-CFA7-42DD-8243-AG5BDA3D475B}",
>           "Title": "lorem ipsum bacon",
>           "Edit": "",
>           "App Modified By": "",
>           "Attachments": "0",
>           "Item Child Count": "",
>           "Created": "2016-02-09 12:35:56",
>           "Modified By": "",
>           "Folder Child Count": "",
>           "Type": "",
>           "Version": "",
>           "Content Type": "", // <-- Missing
>           "Created By": "", // <- Missing
>           "ID": "1",
>           "allow_token_document": "AD+Authority+Group:",
>           "deny_token_document": "AD+Authority+Group:DEAD_AUTHORITY",
>           "allow_token_share": "__nosecurity__",
>           "deny_token_share": "__nosecurity__",
>           "allow_token_parent": "__nosecurity__",
>           "deny_token_parent": "__nosecurity__",
>           "contentfield": ""
>         }
>       }
>     ]
>   }
> }
> {code}
> Not sure what the proper format is yet. [~AndreyL], can you fill this in?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to