elastic 查询

GET /scddb/_search
{
   "size": 2,
  "from": 0,
  "query": { 
    "bool":{
      "must":[
        {
          "bool":{
            "must":[
               {
                 "match": {
                        "title": "名片"
                    }
                },
                  {
                   "match": {
                        "is_show": 1
                    }
                }
              ]
            
              
          }
        },
       {
          "bool":{
            "should":[
                {
                  "match":{
                    "geshi":"psd"
                  }
                  
                }
              ,
                {
                  "match":{
                    "geshi":"ai"
                  }
                  
                }
              ]
            
          }
        }
        
        ]
      
    } 
  },
  "sort":[ 
    {
      "weight":{"order":"desc"}
      
    },
    {
      "newstime":{"order":"desc"}
    }
  
  ]
}

  

posted @ 2019-10-31 09:55  likecs  阅读(138)  评论(0编辑  收藏  举报