一品网
  • 首页

elasticsearch 时间范围搜索


如下,首先,你建立的索引mapping 可以是下面这种格式,不要使用代码自动创建的,手动创建,指定字段类型为 "format": "yyyy-MM-dd HH:mm:ss", "type": "date"

{ 
  "mappings": {
    "company": {
      "properties": {
        "gmtModified": {
          "format": "yyyy-MM-dd HH:mm:ss",
          "type": "date"
        },
        "modifiedBy": {
          "type": "long"
        }
      }
    }
  }
}

然后在代码中使用:
queryBuilder.must(QueryBuilders.rangeQuery("gmtModified")
.from(gmtModified, true)
.to(gmtModified, true));

搜索引擎

相关


在 Spring Boot 中使用搜索引擎 Elasticsearch

SpringBoot2.0 整合 ElasticSearch框架,实现高性能搜索引擎

SpringBoot2.0 整合 ElasticSearch框架,实现高性能搜索引擎

linux系统中安装solr搜索引擎(一)

黑客常用搜索引擎(二)

第三百四十节,Python分布式爬虫打造搜索引擎Scrapy精讲—css选择器

第三百三十九节,Python分布式爬虫打造搜索引擎Scrapy精讲—Scrapy启动文件的配置—xpat

第三百六十五节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)的

第三百六十九节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)用D

第三百六十八节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)用D

第三百五十九节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)介

搜索引擎信息收集(百度)

标签

一品网 冀ICP备14022925号-6