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

  • 相关阅读:
    火车票起售时间
    java基础知识
    java运行
    123
    1233
    那些不能错过的XCode插件
    那些不能错过的XCode插件
    如何正确的在Android中存储特定应用文件
    如何正确的在Android中存储特定应用文件
    问题解决:listview多次调用addHeaderView和addFooterView
  • 原文地址:https://www.cnblogs.com/qiu-hua/p/14194915.html
Copyright © 2011-2022 走看看