File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ TYPO3:
321321 type: date
322322 include_in_all: false
323323 format: 'date_time_no_millis'
324- indexing: '${(node.hiddenBeforeDateTime ? Date.format(node.hiddenBeforeDateTime, "Y-m-d\TH:i:s") + "Z" : null)}'
324+ indexing: '${(node.hiddenBeforeDateTime ? Date.format(node.hiddenBeforeDateTime, "Y-m-d\TH:i:sP") : null)}'
325325```
326326
327327There are a few indexing helpers inside the ` Indexing ` namespace which are usable inside the
@@ -377,6 +377,29 @@ An example:
377377** For a search user interface, checkout the Flowpack.SearchPlugin package**
378378
379379
380+ ## Working with Dates
381+
382+ As a default, ElasticSearch indexes dates in the UTC Timezone. In order to have it index using the timezone
383+ currently configured in PHP, the configuration for any property in a node which represents a date should look like this:
384+
385+ ```
386+ 'My.Blog:Post':
387+ properties:
388+ date:
389+ search:
390+ elasticSearchMapping:
391+ type: 'date'
392+ format: 'date_time_no_millis'
393+ indexing: '${(value ? Date.format(value, "Y-m-d\TH:i:sP") : null)}'
394+ ```
395+
396+ This is important so that Date- and Time-based searches work as expected, both when using formatted DateTime strings and
397+ when using relative DateTime calculations (eg.: ` now ` , ` now+1d ` ).
398+
399+ For more information on ElasticSearch's Date Formats,
400+ [ click here] ( http://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html ) .
401+
402+
380403## Debugging
381404
382405In order to understand what's going on, the following commands are helpful:
You can’t perform that action at this time.
0 commit comments