ElasticSearch学习

Posted wanghongye

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ElasticSearch学习相关的知识,希望对你有一定的参考价值。

ElasticSearch学习

match_all: 全部查询

技术图片
GET dw_app_car_offering_price_ds/_search

  "query": 
    "match_all": 
  
View Code

单个查询

技术图片
GET dw_app_car_offering_price_ds/_search

  "query": 
      "term": 
      "model_code": 
        "value": "12550-n"
      
    
  
View Code

size:默认10条

技术图片
GET dw_app_car_offering_price_ds/_search

  "query": 
      "term": 
      "model_code": 
        "value": "12550-n"
      
    
  ,
  "size": 20
View Code

from  size :从某个from索引的size条数据

技术图片
GET dw_app_car_offering_price_ds/_search

  "query": 
      "term": 
      "source": 
        "value": "che168"
      
    
  ,
  "from": 10, 
  "size": 10
View Code

sort  :排序

技术图片
GET dw_app_car_offering_price_ds/_search

  "query": 
    "bool": 
      "must": [
        
        
          "term": 
          "model_code": 
            "value": "201795"
          
          
          
        ,
        
          "term": 
            "source": 
              "value": "che168"
            
          
        ,
        
          "term": 
            "city_code": 
              "value": "00002"
            
          
        
        
      ]
    
  ,
  "size": 100,
  "sort": [
    
      "ds": 
        "order": "desc"
      
    
  ]
View Code

_source:条件查询

技术图片
GET dw_app_car_offering_price_ds/_search

  "query": 
      "term": 
      "model_code": 
        "value": "12550-n"
      
    
  ,
  "_source": ["offering_price_50","city_code"]
View Code

 

以上是关于ElasticSearch学习的主要内容,如果未能解决你的问题,请参考以下文章

ElasticSearch 学习笔记一 简介

Elasticsearch笔记九之优化

使用标准库Ruby将数据标记到Elasticsearch批量中

IOS开发-OC学习-常用功能代码片段整理

java SpringRetry学习的代码片段

python 机器学习有用的代码片段