Fork me on GitHub

Elasticsearch api

  1. 查询所有get  http://180.76.96.218:9200/film/dongzuo/_search/

     2. 分页查询post http://180.76.96.218:9200/film/dongzuo/_search/

{
  "from": 0,
  "size": 2,
  "_source": {
    "include": [
      "title",
      "price"
    ]
  }
}

3.排序查询post

{
  "sort": [
    {
      "publishDate": {
        "order": "desc"
      }
    }
  ]
}

 

4.简单查询post http://180.76.96.218:9200/film/dongzuo/_search/

{
  "query": {
    "match": {
      "title": "战"
    }
  }
}

 

5.高亮显示post

{
  "query": {
    "match": {
      "title": "战"
    }
  },
  "_source": {
    "include": [
      "title",
      "price"
    ]
  },
  "highlight": {
    "fields": {
      "title": {}
    }
  }
}

 

 

posted @ 2018-10-06 15:36  youxiu326  阅读(115)  评论(0编辑  收藏  举报