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

  • 相关阅读:
    牡牛和牝牛
    卡特兰数 Catalan number
    Codeforces Round #633 (Div. 2)
    Codeforces Round #634 (Div. 3)
    陪审团
    线性DP
    AcWing 274. 移动服务
    Rust打印方法行号
    八.枚举与模式匹配
    七.结构体
  • 原文地址:https://www.cnblogs.com/dongma/p/13611215.html
Copyright © 2011-2022 走看看