From 26ff6e452e26e86d16d064439d76105df3e32e5b Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 24 Jun 2015 08:46:14 -0700 Subject: [PATCH] Fix _ttl default field type to include index/search analyzer (numeric 64bit) --- .../org/elasticsearch/index/mapper/internal/TTLFieldMapper.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java index d30a6228e1b..751f7586880 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java @@ -67,6 +67,8 @@ public class TTLFieldMapper extends LongFieldMapper implements RootMapper { TTL_FIELD_TYPE.setStored(true); TTL_FIELD_TYPE.setTokenized(false); TTL_FIELD_TYPE.setNumericPrecisionStep(Defaults.PRECISION_STEP_64_BIT); + TTL_FIELD_TYPE.setIndexAnalyzer(NumericLongAnalyzer.buildNamedAnalyzer(Defaults.PRECISION_STEP_64_BIT)); + TTL_FIELD_TYPE.setSearchAnalyzer(NumericLongAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE)); TTL_FIELD_TYPE.setNames(new MappedFieldType.Names(NAME)); TTL_FIELD_TYPE.freeze(); }