# 精确查询 （繁体字【阿裏巴巴】、大小写【alibaBa】）
POST /test2/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "name.jingque": "阿裏巴巴"
          }
        }
      ]
    }
  },
  "size": 10000
}

#  前后缀搜索 （wildcard）
POST /test2/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "name.standard":{
              "query": "红米",
              "operator": "and"
            }
          }
        },
        {
          "wildcard": {
            "name.jingque": {
              "value": "*红米"
            }
          }
        }
      ],
       "must_not": [
        {
          "term": {
            "name.jingque": {
              "value": "红米"
            }
          }
        }
      ]
    }
  },
  "size": 10000
}

# 减字
POST /test2/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "name.standard": {
              "query": "红浪漫",
              "minimum_should_match": 2
            }
          }
        },
        {
          "script": {
            "script": "doc['name'].value.length() === 2 "
          }
        }
      ],
      "must_not": [
        {
          "term": {
            "name.jingque": {
              "value": "红浪漫"
            }
          }
        }
      ]
    }
  },
  "size": 10000
}

#读音相同
POST /test2/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "script": {
            "script": "doc['name'].value.length() === 3 "
          }
        },
        {
          "match_phrase": {
            "name.all_pinyin": "红浪漫"
          }
        }
      ],
      "must_not": [
        {
          "term": {
            "name.jingque": {
              "value": "红浪漫"
            }
          }
        }
      ]
    }
  },
  "size": 2000
}

#形近字 (土星、士星)
POST /test2/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "script": {
            "script": "doc['name'].value.length() === 2 "
          }
        },
        {
          "match": {
            "name.standard": {
              "query": "土星",
              "minimum_should_match": 1
            }
          }
        },
        {
          "match_phrase": {
            "name.standard": {
              "analyzer": "xingjinzi", 
              "query": "土星"
            }
          }
        }
      ],
      "must_not": [
        {
          "term": {
            "name.jingque": {
              "value": "土星"
            }
          }
        }
      ]
    }
  },
  "size": 10000
}

#近似词 (巧媳妇,巧老婆)
POST /test2/_search
{
  "query": {
    "bool": {
      "must": [
         {
          "script": {
            "script": "doc['name'].value.length() === 3 "
          }
        },
        {
          "match_phrase": {
            "name.tongyici":{
              "query": "巧媳妇"
            }
          }
        }
      ],
      "must_not": [
        {
          "term": {
            "name.jingque": {
              "value": "巧媳妇"
            }
          }
        },{
          "wildcard": {
            "name.jingque": {
              "value": "*巧媳妇*"
            }
          }
        }
      ]
    }
  },
  "size": 10000
}