Como o ES usa requestbody para consultar

GET kibana_sample_data_ecommerce/_search
{
  "_source": ["order_date","day_of_week"], 
  "sort":[{"order_date": "desc"}],
  "from":"10",
  "size": 2,
  "query": {
    "match_all": {}
  }
}

Se houver um campo do tipo array

GET kibana_sample_data_ecommerce/_search
{
  "query": {
    "match": {
      "products.base_price": "90"
    }
    
  }
}
GET kibana_sample_data_ecommerce/_search
{
  "query": {
    "match": {
      "customer_full_name": {
        "query": "Eddie Perry",
        "operator": "and"
      }
    }
    
  }
}

----------------------MAPEAMENTO--------------------------- -

1 consulta de valor nulo

PUT null_value_test
{
  "mappings" : {
      "properties" : {
        "first_name" : {
          "type" : "text"
          
        },
        "last_name" : {
          "type" : "text"
 
        },
        "mobile" : {
          "type" : "keyword",
          "null_value": "NULLNULL"
        }
      }
    }
}

2 cópias para

PUT copy_to_test
{
  "mappings" : {
      "properties" : {
        "first_name" : {
          "type" : "text",
          "copy_to":"full_name"
        },
        "last_name" : {
          "type" : "text",
          "copy_to":"full_name"
        } 
      }
    }
}
PUT copy_to_test/_doc/1
{
  "first_name":"qi",
  "last_name":"hongfei"
}

PUT copy_to_test/_doc/2
{
  "first_name":"liu",
  "last_name":"yifei"
}
GET copy_to_test/_search
GET copy_to_test/_search?q=full_name:liu yifei

 

 

Acho que você gosta

Origin blog.csdn.net/weixin_39394909/article/details/105331475
Recomendado
Clasificación