zoukankan      html  css  js  c++  java
  • es查询例子

    创建索引和类型

    GET /lib3/user
    {
        "mappings" : {
            "user":{
                "properties":{
                    "name":{"type":"text"},
                    "address":{"type":"text"},
                    "age":{"type":"integer"},
                    "interests":{"type":"text"},
                    "bibrthday":{"type":"date"}
                }
            }
        }
    }

    添加数据

    PUT /lib3/user/6
    {
                        "name": "张三",
                        "address": "北京海淀区清河",
                        "age": 29,
                        "bibrthday": "1998-10-12",
                        "interests": "喜欢摄影,听音乐,跳舞"
                    }
    {
                        "name": "赵明",
                        "address": "北京海淀区清河",
                        "age": 20,
                        "bibrthday": "1998-10-12",
                        "interests": "喜欢喝酒,锻炼,唱歌"
                    }
                }
    {
                        "name": "王五",
                        "address": "北京海淀区清河",
                        "age": 26,
                        "bibrthday": "1995-10-12",
                        "interests": "喜欢编程,听音乐,旅游"
                    }
                }
    {
                        "name": "赵六",
                        "address": "黑龙江省铁岭",
                        "age": 50,
                        "interests": "喜欢喝酒,锻炼,说相声",
                        "bibrthday": "1970-12-12"
                    }
                }
    {
                        "name": "lisi",
                        "address": "北京海淀区清河",
                        "age": 23,
                        "bibrthday": "1998-10-12",
                        "interests": "喜欢喝酒,锻炼,唱歌"
                    }

    filter 查询不计算相关性,同时可以使用cache,因此filter的速度大于query

  • 相关阅读:
    JVM原理---------------1.开篇
    mysql开启事务的方式,命令学习
    mysql中的锁
    mysql索引底层原理
    mysql的常见存储引擎与常见日志类型,以及4种线程的作用
    Mutex
    委托和匿名委托
    线程通信
    同步锁
    [ValidateInput(false)]
  • 原文地址:https://www.cnblogs.com/dongma/p/13611215.html
Copyright © 2011-2022 走看看