zoukankan      html  css  js  c++  java
  • 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
    }
    }
    }

  • 相关阅读:
    html常用标签_new
    Nginx缓存
    购物车
    css的属性选择
    前端基础之css
    htm基础知识
    TypeScript(1)为什么需要TypeScript
    Electron
    Ant Design
    Umi
  • 原文地址:https://www.cnblogs.com/merciless/p/12718807.html
Copyright © 2011-2022 走看看