ElasticSearch基本操作-查询操作

查询所有

GET /how2java/_search
{
    "query": { "match_all": {} }
}

id 倒排序

GET /how2java/_search
{
  "query": { "match_all": {} },
  "sort": [
    { "_id": "desc" }
  ]
}

只返回部分字段

GET /how2java/_search
{
  "query": { "match_all": {} },
  "_source": ["name","price"]
}

条件查询

GET /how2java/_search
{
  "query": { "match": { "name": "时尚连衣裙" } }
}

分页查询

GET /how2java/_search
{
  "query": { "match_all": {} },
  "from": 1,
  "size": 3,
  "sort": { "_id": { "order": "desc" } }
}

 

 

你可能感兴趣的:(ElasticSearch,es,elasticsearch,java,mysql,sql)