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

  • 相关阅读:
    需求分析作业01
    2016年秋季个人阅读计划
    个人总结
    梦断代码读后感03
    进度条16
    我的第一个小系统总结
    进度条15
    eclipse连接SqlServer2008(被它搞得惨兮兮)
    梦断代码读后感02
    Android ViewPager刷新解析
  • 原文地址:https://www.cnblogs.com/dongma/p/13611215.html
Copyright © 2011-2022 走看看