I've got the issue and solution. In above mapping specified, _all > enabled should be True in order to enable _timestamp and store it. Hence, closing the post.
On Wednesday, 19 March 2014 19:31:35 UTC+5:30, nishidha randad wrote: > Hi, > > I've been facing an issue retrieving _timestamp for one of my indices. > Below is the mapping of my index - > > "my_index_1": { > "settings": { > "index": { > "number_of_shards": 4, > "number_of_replicas": 1 > }, > "aliases": [ > "my_index" > ] > }, > "mappings": { > "my_index_type": { > "_all": { > "enabled": False > }, > "_timestamp": { > "enabled": True, > "store": True > }, > "properties": { > ... > } > } > } > } > > I'm using below query to get all documents updated after certain timestamp > (xyz in miliseconds) - > { > "fields": [ > "_timestamp", > "_source" > ], > "query": { > "filtered": { > "query": { > "match_all": {} > }, > "filter": { > "range": { > "_timestamp": { > "gte": xyz > } > } > } > } > } > } > > But this is returning me all the documents in my index including the ones > that are not updated after xyz time and moreover, in the output, I don't > see _timestamp field. Kindly help me with this issue. Also, note that I > cannot change the mapping of my index. > > Thanks in advance, > Nishidha > -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b9a324d2-3c6a-49fc-af72-3b9663a2f9a0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.