Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Last Accessed date and Created date #580

Merged
merged 5 commits into from
Jul 30, 2018

Conversation

dadoonet
Copy link
Owner

This change brings 2 new fields: file.created and file.last_accessed.

It also changes a little bit the implementation of file.last_modified which is using now BasicFileAttributes#lastModifiedTime() instead
of File#lastModified(). The main difference is that one was a number (ms since Epoch). It's now using a readable String.

A typical document now looks like:

{
   "content":"This is a sample text available in page 1\n\nThis second part of the text is in Page 2\n\n",
   "meta":{
      "author":"David Pilato",
      "title":"Test Tika title",
      "date":"2016-07-07T16:37:00.000+0000",
      "keywords":[
         "keyword1",
         "  keyword2"
      ],
      "language":"en",
      "description":"Comments",
      "created":"2016-07-07T16:37:00.000+0000"
   },
   "file":{
      "extension":"odt",
      "content_type":"application/vnd.oasis.opendocument.text",
      "created":"2018-07-30T11:35:08.000+0000",
      "last_modified":"2018-07-30T11:35:08.000+0000",
      "last_accessed":"2018-07-30T11:35:08.000+0000",
      "indexing_date":"2018-07-30T11:35:19.781+0000",
      "filesize":6236,
      "filename":"test.odt",
      "url":"file:///tmp/test.odt"
   },
   "path":{
      "root":"7537e4fb47e553f110a1ec312c2537c0",
      "virtual":"/test.odt",
      "real":"/tmp/test.odt"
   }
}

Closes #578.

This change brings 2 new fields: `file.created` and `file.last_accessed`.

It also changes a little bit the implementation of `file.last_modified` which is using now `BasicFileAttributes#lastModifiedTime()` instead
of `File#lastModified()`. The main difference is that one was a number (ms since Epoch). It's now using a readable String.

A typical document now looks like:

```json
{
   "content":"This is a sample text available in page 1\n\nThis second part of the text is in Page 2\n\n",
   "meta":{
      "author":"David Pilato",
      "title":"Test Tika title",
      "date":"2016-07-07T16:37:00.000+0000",
      "keywords":[
         "keyword1",
         "  keyword2"
      ],
      "language":"en",
      "description":"Comments",
      "created":"2016-07-07T16:37:00.000+0000"
   },
   "file":{
      "extension":"odt",
      "content_type":"application/vnd.oasis.opendocument.text",
      "created":"2018-07-30T11:35:08.000+0000",
      "last_modified":"2018-07-30T11:35:08.000+0000",
      "last_accessed":"2018-07-30T11:35:08.000+0000",
      "indexing_date":"2018-07-30T11:35:19.781+0000",
      "filesize":6236,
      "filename":"test.odt",
      "url":"file:///tmp/test.odt"
   },
   "path":{
      "root":"7537e4fb47e553f110a1ec312c2537c0",
      "virtual":"/test.odt",
      "real":"/tmp/test.odt"
   }
}
```

Closes #578.
@dadoonet dadoonet added the new For new features or options label Jul 30, 2018
@dadoonet dadoonet added this to the 2.5 milestone Jul 30, 2018
@dadoonet dadoonet self-assigned this Jul 30, 2018
It sounds to depend on the OS we run our tests.
No issue on Mac OS but apparently some problems on some Linux OS.
# Conflicts:
#	docs/source/admin/fs/elasticsearch.rst
@dadoonet dadoonet merged commit 1c6c4ae into master Jul 30, 2018
@dadoonet dadoonet deleted the fix/578-accessed-date branch July 30, 2018 21:05
@dadoonet dadoonet changed the title Add support for Last Accessed Date Add support for Last Accessed date and Created date Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new For new features or options
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant