美文网首页
elasticSearch 基本http操作

elasticSearch 基本http操作

作者: 摩V羯座 | 来源:发表于2020-10-23 17:18 被阅读0次

    create index

    Method.put address/indexName

    delete index

    Method.delete address/indexName

    create _mapping

    Method.post address/indexName/typeName/_mapping

    {
      "properties": {
        "testid": {
          "type": "keyword"
        },
        "stu_code": {
          "type": "keyword"
        },
        "stu_name": {
          "type": "keyword"
        },
        "stu_age": {
          "type": "keyword"
        },
        "stu_date": {
          "type": "text"
        }
      }
    }
    

    get mapping

    Method.get address/index/_mapping

    create or update doc

    Method.post address/indexName/typeName/docid

    { "testid":"2", "stu_code":"1A0001", "stu_name":"testName", "stu_age":"30", "stu_date":"1528887157215"}
    

    query doc

    Method.post address/indexName/_search

    {
        "query":{
            "match_all":{}
        }
    }
    

    delete doc

    Method.post address/indexName/type/_delete_by_query

    {
        "query":{
            "match_all":{}
        }
    }
    

    相关文章

      网友评论

          本文标题:elasticSearch 基本http操作

          本文链接:https://www.haomeiwen.com/subject/ygovmktx.html