社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
私信  •  关注

Wijayanga Wijekoon

Wijayanga Wijekoon 最近回复了
6 年前
回复了 Wijayanga Wijekoon 创建的主题 » 表错误中的MySQL自动增量键

删除行后使用此查询,

实际上,这就是MySQL的工作原理,这不是一个错误

6 年前
回复了 Wijayanga Wijekoon 创建的主题 » Elasticsearch按自定义项权重排序
Here's the code sample of sorting result. I think this will helps you. If you don't want to get entire documents as result you can filter results using includes. 

GET testindex/_search
{
  "_source": {
"includes": [
  "filed1"
]
},
  "aggs": {
    "emp_figures": {
      "terms": {
        "field": "status"
      }
    }
}
}

This is the sample result you should retrieve 
{
  "took": 11,
  "timed_out": false,
  "_shards": {
    "total": 2,
    "successful": 2,
    "failed": 0
  },
  "hits": {
    "total": 84968,
    "max_score": 1,
    "hits": [
      {
        "_index": "test",
        "_type": "type",
        "_id": "0001",
        "_score": 1,
        "_source": {
          "filed1": "color1,
          }
        },
         {
        "_index": "test",
        "_type": "type",
        "_id": "0002",
        "_score": 1,
        "_source": {
          "filed1": "color2,
          }
        }
      }
    }
}