Indexing a java.sql.Timestamp works fine. The index contains
02.05.1980 13:30:00
for the field.
Creating a search using it gives the following exception:
DEBUG 16:38:45 count: [TestNode] [testindex][0], node[1], [P],
s[STARTED]: Failed to execute [[[testindex]][doc],
querySource[{"constant_score":{"filter":{"numeric_range":{"doc.timestamp_1":{"from":"1980-04-30","to":null,"include_lower":true,"include_upper":true}}}}}]]
org.elasticsearch.index.query.QueryParsingException: [testindex] Field
[doc.timestamp_1] is not a numeric type
at
org.elasticsearch.index.query.NumericRangeFilterParser.parse(NumericRangeFilterParser.java:113)
~[elasticsearch-0.17.4.jar:na]
[...]
querySource[{"constant_score":{"filter":{"numeric_range":{"doc.timestamp_1":{"from":"1980-04-30","to":null,"include_lower":true,"include_upper":true}}}}}]]
org.elasticsearch.index.query.QueryParsingException: [testindex] Field
[doc.timestamp_1] is not a numeric type
at
Not to pile on, but there is the Calendar class, and the Joda-Time's
DateTime object.
I doubt you want to support a lot of different classes that support
Date/Time functions from other classes. Is there a way to register a type
conversion implementation?
That conversion only applies when using XContentBuilder, or when providing a
Map. I would hate to duplicate excellent work already done by other Json
libraries (like Jackson) where you can fully control how to convert your
domain model to json, and then just provide it to elasticsearch to index. So
I would say that if you need to register a custom converter, then go with
using jackson yourself.
Not to pile on, but there is the Calendar class, and the Joda-Time's
DateTime object.
I doubt you want to support a lot of different classes that support
Date/Time functions from other classes. Is there a way to register a type
conversion implementation?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.