• es-dsl笔记


    查询所有的索引信息
    GET /_cat/indices?v

    //查询映射关系
    GET /index_name/_mapping?pretty=true

    查询所有的索引
    POST /_xpack/sql?format=txt
    {
    "query": "SHOW tables"
    }

    一些简单的sql转换成dsl
    GET /_xpack/sql/translate
    {
    "query":"select * from index_name where xxx=xxx "
    }
    特殊字符需要转义 "query":"select * from "funmall-gemini-channel-service" "

    {
    "_source": [
    "thumbnailUrl"
    ],
    "query": {
    "bool": {
    "must": [
    {
    "bool": {
    "must_not": [
    {
    "exists": {
    "field": "thumbnailUrl"
    }
    }
    ]
    }
    }
    ]
    }
    },
    "script": {
    "lang": "painless",
    "inline": "ctx._source.thumbnailUrl = params.thumbnailUrl;",
    "params": {
    "thumbnailUrl": "http://xxxx.qq.com"
    }
    }
    }

    select * from xxx where a=xx and (applyScene in(1,2) or cmbMobileApplyScene in (1,3))
    {
    "from": 0,
    "size": 10,
    "query": {
    "bool": {
    "must": [
    {
    "bool": {
    "should": [
    {
    "terms": {
    "applyScene": [
    "1",
    "2"
    ],
    "boost": 1
    }
    },
    {
    "terms": {
    "cmbMobileApplyScene": [
    "1",
    "3"
    ],
    "boost": 1
    }
    }
    ],
    "adjust_pure_negative": true,
    "boost": 1
    }
    },
    {
    "terms": {
    "shopNo": [
    "ST20133"
    ],
    "boost": 1
    }
    }
    ],
    "adjust_pure_negative": true,
    "boost": 1
    }
    }
    }

  • 相关阅读:
    用PYTHON修改电脑IP地址
    PYTHON os 模块详解
    django 笔记
    PYTHON实战目录
    群晖PLEX设置方法
    jellin docker 群晖设置方法转自先生
    PYTHON ftp 上传方法
    打包驱动EXSI
    我的PYTHON老师ALEX
    安装WHELL
  • 原文地址:https://www.cnblogs.com/merciless/p/12718807.html
Copyright © 2020-2023  润新知