- Elasticsearch Guide: other versions:
- Getting Started
- Setup
- Breaking changes
- API Conventions
- Document APIs
- Search APIs
- Search
- URI Search
- Request Body Search
- Search Template
- Search Shards API
- Aggregations
- Min Aggregation
- Max Aggregation
- Sum Aggregation
- Avg Aggregation
- Stats Aggregation
- Extended Stats Aggregation
- Value Count Aggregation
- Percentiles Aggregation
- Percentile Ranks Aggregation
- Cardinality Aggregation
- Geo Bounds Aggregation
- Top hits Aggregation
- Scripted Metric Aggregation
- Global Aggregation
- Filter Aggregation
- Filters Aggregation
- Missing Aggregation
- Nested Aggregation
- Reverse nested Aggregation
- Children Aggregation
- Terms Aggregation
- Significant Terms Aggregation
- Range Aggregation
- Date Range Aggregation
- IPv4 Range Aggregation
- Histogram Aggregation
- Date Histogram Aggregation
- Geo Distance Aggregation
- GeoHash grid Aggregation
- Facets
- Suggesters
- Multi Search API
- Count API
- Search Exists API
- Validate API
- Explain API
- Percolator
- More Like This API
- Indices APIs
- Create Index
- Delete Index
- Get Index
- Indices Exists
- Open / Close Index API
- Put Mapping
- Get Mapping
- Get Field Mapping
- Types Exists
- Delete Mapping
- Index Aliases
- Update Indices Settings
- Get Settings
- Analyze
- Index Templates
- Warmers
- Status
- Indices Stats
- Indices Segments
- Indices Recovery
- Clear Cache
- Flush
- Refresh
- Optimize
- Upgrade
- Shadow replica indices
- cat APIs
- Cluster APIs
- Query DSL
- Queries
- Match Query
- Multi Match Query
- Bool Query
- Boosting Query
- Common Terms Query
- Constant Score Query
- Dis Max Query
- Filtered Query
- Fuzzy Like This Query
- Fuzzy Like This Field Query
- Function Score Query
- Fuzzy Query
- GeoShape Query
- Has Child Query
- Has Parent Query
- Ids Query
- Indices Query
- Match All Query
- More Like This Query
- Nested Query
- Prefix Query
- Query String Query
- Simple Query String Query
- Range Query
- Regexp Query
- Span First Query
- Span Multi Term Query
- Span Near Query
- Span Not Query
- Span Or Query
- Span Term Query
- Term Query
- Terms Query
- Top Children Query
- Wildcard Query
- Minimum Should Match
- Multi Term Query Rewrite
- Template Query
- Filters
- And Filter
- Bool Filter
- Exists Filter
- Geo Bounding Box Filter
- Geo Distance Filter
- Geo Distance Range Filter
- Geo Polygon Filter
- GeoShape Filter
- Geohash Cell Filter
- Has Child Filter
- Has Parent Filter
- Ids Filter
- Indices Filter
- Limit Filter
- Match All Filter
- Missing Filter
- Nested Filter
- Not Filter
- Or Filter
- Prefix Filter
- Query Filter
- Range Filter
- Regexp Filter
- Script Filter
- Term Filter
- Terms Filter
- Type Filter
- Queries
- Mapping
- Analysis
- Analyzers
- Tokenizers
- Token Filters
- Standard Token Filter
- ASCII Folding Token Filter
- Length Token Filter
- Lowercase Token Filter
- Uppercase Token Filter
- NGram Token Filter
- Edge NGram Token Filter
- Porter Stem Token Filter
- Shingle Token Filter
- Stop Token Filter
- Word Delimiter Token Filter
- Stemmer Token Filter
- Stemmer Override Token Filter
- Keyword Marker Token Filter
- Keyword Repeat Token Filter
- KStem Token Filter
- Snowball Token Filter
- Phonetic Token Filter
- Synonym Token Filter
- Compound Word Token Filter
- Reverse Token Filter
- Elision Token Filter
- Truncate Token Filter
- Unique Token Filter
- Pattern Capture Token Filter
- Pattern Replace Token Filter
- Trim Token Filter
- Limit Token Count Token Filter
- Hunspell Token Filter
- Common Grams Token Filter
- Normalization Token Filter
- CJK Width Token Filter
- CJK Bigram Token Filter
- Delimited Payload Token Filter
- Keep Words Token Filter
- Keep Types Token Filter
- Classic Token Filter
- Apostrophe Token Filter
- Character Filters
- ICU Analysis Plugin
- Modules
- Index Modules
- Testing
- Glossary of terms
WARNING: Version 1.5 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
_timestamp
edit_timestamp
editThe _timestamp
field allows to automatically index the timestamp of a
document. It can be provided externally via the index request or in the
_source
. If it is not provided externally it will be automatically set
to a default date.
enabled
editBy default it is disabled. In order to enable it, the following mapping should be defined:
{ "tweet" : { "_timestamp" : { "enabled" : true } } }
store / index
editBy default the _timestamp
field has store
set to false
and index
set to not_analyzed
. It can be queried as a standard date field.
path
editThe _timestamp
value can be provided as an external value when
indexing. But, it can also be automatically extracted from the document
to index based on a path
. For example, having the following mapping:
{ "tweet" : { "_timestamp" : { "enabled" : true, "path" : "post_date" } } }
Will cause 2009-11-15T14:12:12
to be used as the timestamp value for:
{ "message" : "You know, for Search", "post_date" : "2009-11-15T14:12:12" }
Note, using path
without explicit timestamp value provided requires an
additional (though quite fast) parsing phase.
format
editYou can define the date format used to parse the provided timestamp value. For example:
{ "tweet" : { "_timestamp" : { "enabled" : true, "path" : "post_date", "format" : "YYYY-MM-dd" } } }
Note, the default format is dateOptionalTime
. The timestamp value will
first be parsed as a number and if it fails the format will be tried.
default
editYou can define a default value for when timestamp is not provided
within the index request or in the _source
document.
By default, the default value is now
which means the date the document was processed by the indexing chain.
You can reject documents which do not provide a timestamp
value by setting ignore_missing
to false (default to true
):
{ "tweet" : { "_timestamp" : { "enabled" : true, "ignore_missing" : false } } }
You can also set the default value to any date respecting timestamp format:
{ "tweet" : { "_timestamp" : { "enabled" : true, "format" : "YYYY-MM-dd", "default" : "1970-01-01" } } }
If you don’t provide any timestamp value, _timestamp will be set to this default value.
Added in 1.5.0.
In elasticsearch 1.4, we allowed setting explicitly "default":null
which is not possible anymore
as we added a new ignore_missing
setting.
When reading an index created with elasticsearch 1.4 and using this, we automatically update it by
removing "default": null
and setting "ignore_missing": false
On this page