zoukankan      html  css  js  c++  java
  • ES基础(七)URI Search详解

     

     

     

     

     

    课程Demo

    #基本查询
    GET /movies/_search?q=2012&df=title&sort=year:desc&from=0&size=10&timeout=1s
    
    #带profile
    GET /movies/_search?q=2012&df=title
    {
        "profile":"true"
    }
    
    
    #泛查询,正对_all,所有字段
    GET /movies/_search?q=2012
    {
        "profile":"true"
    }
    
    #指定字段
    GET /movies/_search?q=title:2012&sort=year:desc&from=0&size=10&timeout=1s
    {
        "profile":"true"
    }
    
    
    # 查找美丽心灵, Mind为泛查询
    GET /movies/_search?q=title:Beautiful Mind
    {
        "profile":"true"
    }
    
    # 泛查询
    GET /movies/_search?q=title:2012
    {
        "profile":"true"
    }
    
    #使用引号,Phrase查询
    GET /movies/_search?q=title:"Beautiful Mind"
    {
        "profile":"true"
    }
    
    #分组,Bool查询
    GET /movies/_search?q=title:(Beautiful Mind)
    {
        "profile":"true"
    }
    
    
    #布尔操作符
    # 查找美丽心灵
    GET /movies/_search?q=title:(Beautiful AND Mind)
    {
        "profile":"true"
    }
    
    # 查找美丽心灵
    GET /movies/_search?q=title:(Beautiful NOT Mind)
    {
        "profile":"true"
    }
    
    # 查找美丽心灵
    GET /movies/_search?q=title:(Beautiful %2BMind)
    {
        "profile":"true"
    }
    
    
    #范围查询 ,区间写法
    GET /movies/_search?q=title:beautiful AND year:[2002 TO 2018%7D
    {
        "profile":"true"
    }
    
    
    #通配符查询
    GET /movies/_search?q=title:b*
    {
        "profile":"true"
    }
    
    //模糊匹配&近似度匹配
    GET /movies/_search?q=title:beautifl~1
    {
        "profile":"true"
    }
    
    GET /movies/_search?q=title:"Lord Rings"~2
    {
        "profile":"true"
    }

    本文来自博客园,作者:秋华,转载请注明原文链接:https://www.cnblogs.com/qiu-hua/p/14194915.html

  • 相关阅读:
    4.变量与运算符
    2.python的基本数据类型
    bzoj 2337: [HNOI2011]XOR和路径
    bzoj 2109: [Noi2010]Plane 航空管制
    bzoj 1566: [NOI2009]管道取珠
    bzoj 3439: Kpm的MC密码
    bzoj 2957: 楼房重建
    十、mysql之索引原理与慢查询优化
    九、MySQL 5.7.9版本sql_mode=only_full_group_by问题
    八、多表查询
  • 原文地址:https://www.cnblogs.com/qiu-hua/p/14194915.html
Copyright © 2011-2022 走看看