TomonoriSoejima / Tejun

notes related to working cases
5 stars 3 forks source link

dynamic mapping test #79

Open TomonoriSoejima opened 2 years ago

TomonoriSoejima commented 2 years ago
POST /_template/template1
{
  "index_patterns": [
    "index*"
  ],
  "settings": {
    "index": {

      "number_of_shards": 1,
      "number_of_replicas": 1
    }
  },
  "mappings": {
    "properties": {
      "field1": {
        "type": "text"
      }
    }
  }
}

jo -p field1=f1 | http -b POST http://localhost:9200/index_go/_doc/1

jo -p field1=ea, field2=jo | http -b POST http://localhost:9200/index_go/_doc/2

POST /_template/template1
{
  "index_patterns": [
    "index*"
  ],
  "settings": {
    "index": {
      "number_of_shards": 1,
      "number_of_replicas": 1
    }
  },
  "mappings": {
    "properties": {
      "field1": {
        "type": "text"
      },
      "field2": {
        "type": "text"
      }
    }
  }
}