如何在弹性搜索的uri请求搜索中查找日期范围 [英] how to find the date range in uri request search in elasticsearch

查看:122
本文介绍了如何在弹性搜索的uri请求搜索中查找日期范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个搜索,我需要找到数据的增量
http:// localhost:9200 / index / index_type / _search?q = sampledate [21-02-2015 TO 22-02-2015]

I have a search in which i need to find the delta of data http://localhost:9200/index/index_type/_search?q=sampledate[21-02-2015 TO 22-02-2015]

但是这个搜索给我的错误
可以帮助吗?

but this search is giving me error could anybody help?

推荐答案

你可以使用下面的查询:

You can use below query:

GET /index_name/index_type/_search?q=dateCreated:[2016-01-06+TO+2016-01-07]

只有在 dateCreated 是一个日期字段。不能使用 String

This will work only if dateCreated is a date field. Won't work with String

这篇关于如何在弹性搜索的uri请求搜索中查找日期范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆