scala - How to make elastic4s store _timestamp field? -
i'm able enable timestamp on mapping :
"sometype" ( "somefield" typed stringtype ) timestamp true
but able retrieve when searching using "fields": ["_timestamp"]
needs have store
attribute set true
. if :
"sometype" ( "somefield" typed stringtype, "_timestamp" typed longtype/datetype store true ) timestamp true
then not returned _search
:
get /myindex/sometype/_search { "fields": ["_timestamp"], "query" : { "match_all" : {} } }
the resulting mapping looks :
"sometype": { "dynamic": "dynamic", "_timestamp": { "enabled": true }, "properties": { "_timestamp": { "store": "yes", "type": "long" } }
}
but i've got feeling should :
"sometype": { "dynamic": "dynamic", "_timestamp": { "enabled": true, "store": true }, "properties": { "_timestamp": { "store": "yes", "type": "long" } } }
which cannot done using elastic4s
dsl because doesn't have special handling fields named _timestamp
field goes properties instead of fields in mapping...
elastic4s version 1.5.7 allows set timestamp this:
create index("myindex") mappings( mapping name "foo" timestamp { timestamp enabled true format "qwerty" store true path "somepath" } )
path, format, , store optional.
Comments
Post a Comment