# Unable to store the data in index

**URL:** <https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332>\
**Category:** Elasticsearch\
**Created:** [June 11, 2018, 10:15am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332 "2018-06-11T10:15:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 11, 2018, 10:15am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/1 "2018-06-11T10:15:12Z")

</div>

Hello -

I have the below format to store the data and in my logs i able to see that data is stored but when i execute indices or see data stored i am getting nothing.

API used to store the data:

```
put1, err := elasticSearchClient.Index().
			Index(RegisterIndex).
			Type(RegisterDocType).
			BodyJson(reg).
			Do(elasticSearchContext)
		if err != nil {
			log.Println("Failed to store register entry, ", err.Error())
			return err
		}
log.Println("Indexed", put1.Id, "to index", put1.Index, "type \n", put1.Type)

```

Here RegisterIndex is 'register'  
And in my logs i able to see that data is stored through the index id

> _2018/06/11 15:31:04 register info----\> {HLRCALLP-01 RegSyveOS-nokiahsshlr01 hlrcallp 2a00:8a00:a000:4000:0:0:c0a8:4616}_  
> _2018/06/11 15:31:04 Indexed AWPuSrmbVIR4QuMOWYGv to index register type register_

But when i check the incide i see the doc count as still zero.

> ```
> health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
> green open register wvt1sSx2QnyhqDKSVURfOg 5 1 **0** 0 1.4kb 766b
> 
> ```

And my mapping is us follows

```
 curl -X GET "localhost:9200/register/_mapping/"
`{"register":{"mappings":{"register":{"properties":{"Address":{"type":"ip"},"NodeName":{"type":"keyword"},"NodeType":{"type":"keyword"},"Uuid":{"type":"keyword"}}}}}}`

root@nhss01vm01oam02> curl http://localhost:9200/register/_mapping/register/field/Address?pretty
{
  "register" : {
    "mappings" : {
      "register" : {
        "Address" : {
          "full_name" : "Address",
          "mapping" : {
            "Address" : {
              "type" : "ip"
            }
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 12, 2018, 12:24pm UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/3 "2018-06-12T12:24:52Z")

</div>

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

---

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 12, 2018, 1:24pm UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/4 "2018-06-12T13:24:03Z")

</div>

I have edited to my best. kindly check

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 12, 2018, 9:06pm UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/5 "2018-06-12T21:06:22Z")

</div>

Great. Next time don't use both quotes `>` and code formatting. It's not necessary.

Is there any way to trace exactly what is sent to elasticsearch when you call you index API from your client? I mean the REST call that is done behind the scene (URL + Body)?

Sounds like it's successful but would like to double-check.

What gives:

```
GET register/register/AWPuSrmbVIR4QuMOWYGv

```

When you run that in Kibana?

---

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 13, 2018, 7:11am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/6 "2018-06-13T07:11:29Z")

</div>

We do not use Kibana here.  
REST API call:

> ```
> func saveRegisterInfo(reg RegisterInfo) (err error) {
> log.Println("Received data -> ", reg)
> if !registerExists(reg) {
> put1, err := elasticSearchClient.Index().
> Index(RegisterIndex).
> Type(RegisterDocType).
> BodyJson(reg).
> Do(elasticSearchContext)
> if err != nil {
> log.Println("Failed to store register entry, ", err.Error())
> return err
> }
> log.Println("err ->", err)
> log.Println("Indexed", put1.Id, "to index", put1.Index, "type \n", put1.Type)
> } else {
> log.Println("Registration exists, skipped")
> // TODO: check and remove multiple records and store new one.
> }
> return err
> }
> 
> ```

Data sent which is captured in log, recent log

> ```
> 2018/06/13 12:33:28 Received data -> {HLRCALLP-01 RegSyveOS-nokiahsshlr01 hlrcallp 2a00:8a00:a000:4000:0:0:c0a8:4616}
> 2018/06/13 12:33:28 err -> <nil>
> 2018/06/13 12:33:28 Indexed AWP39NZKp9wSKrdECrkB to index register type register
> 
> ```

And output requested

> ```
> root@nhss01vm01oam02> curl -XGET "http://localhost:9200/register/register/AWP39NZKp9wSKrdECrkB?pretty"
> {
> "_index" : "register",
> "_type" : "register",
> "_id" : "AWP39NZKp9wSKrdECrkB",
> "found" : false
> }
> 
> ```

I even tried to search in all index

> ```
> root@nhss01vm01oam02> curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
> {
> "query": {
> "ids" : {
> "values" : ["AWP39NZKp9wSKrdECrkB"]
> }
> }
> }'
> {
> "took" : 7,
> "timed_out" : false,
> "_shards" : {
> "total" : 65,
> "successful" : 65,
> "failed" : 0
> },
> "hits" : {
> "total" : 0,
> "max_score" : null,
> "hits" : []
> }
> }
> 
> ```

Some extra info, which might be useful

> ```
> root@nhss01vm01oam02> curl -XGET 'localhost:9200/_cat/health?v&pretty'
> epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
> 1528874138 12:45:38 elastic-OAMUNIT green 3 3 130 65 0 0 0 0 - 100.0%
> (reverse-i-search)`in': curl http://localhost:9200/register/_mapp^Cg/register/field/Address?pretty
> root@nhss01vm01oam02> curl -X GET "localhost:9200/register/_mapping?pretty&pretty"
> {
> "register" : {
> "mappings" : {
> "register" : {
> "dynamic" : "strict",
> "properties" : {
> "Address" : {
> "type" : "ip"
> },
> "NodeName" : {
> "type" : "keyword"
> },
> "NodeType" : {
> "type" : "keyword"
> },
> "Uuid" : {
> "type" : "keyword"
> }
> }
> }
> }
> }
> }
> root@nhss01vm01oam02> curl -XGET 'localhost:9200/_cat/indices?v&pretty'
> health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
> 
> green open register bGAIpg0_RyqbUeEH0bJFYQ 5 1 0 0 1.5kb 795b
> 
> ```

---

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 13, 2018, 1:17pm UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/7 "2018-06-13T13:17:48Z")

</div>

Am i missing something?

---

<div class="post-metadata">

**Author:** ![xeraa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xeraa/32/48181_2.png) [@xeraa](https://discuss.elastic.co/u/xeraa)\
**Post date:** [June 13, 2018, 4:39pm UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/8 "2018-06-13T16:39:23Z")

</div>

Can you run a GET on the ID you are getting back from your program right after inserting the data (should translate to `curl -XGET http://localhost:9200/register/register/AWP39NZKp9wSKrdECrkB`)?

PS: Please no pings. We are doing our best to help, but daily pings about your issue are not the way to do this.

---

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 13, 2018, 5:48pm UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/9 "2018-06-13T17:48:09Z")

</div>

Already i have posted the results , posting again.

> curl -XGET [http://localhost:9200/register/register/AWP39NZKp9wSKrdECrkB?pretty](http://localhost:9200/register/register/AWP39NZKp9wSKrdECrkB?pretty)"  
> { "\_index" : "register", "\_type" : "register", "\_id" : "AWP39NZKp9wSKrdECrkB", "found" : false }

---

<div class="post-metadata">

**Author:** ![xeraa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xeraa/32/48181_2.png) [@xeraa](https://discuss.elastic.co/u/xeraa)\
**Post date:** [June 13, 2018, 9:12pm UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/10 "2018-06-13T21:12:39Z")

</div>

No, do it from within your program, since this seems to write data somewhere (right after the line `log.Println("Indexed", put1.Id, "to index", put1.Index, "type \n", put1.Type)`). If Elasticsearch is returning you an ID, it should index this doc. I just want to ensure that you are talking to the same Elasticsearch instance, nothing else in the rest of your program can delete the data before you query it,...

---

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 14, 2018, 7:14am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/12 "2018-06-14T07:14:44Z")

</div>

I tried to print along with program  
Code snippet

```
> func saveRegisterInfo(reg RegisterInfo) (err error) {
> if !registerExists(reg) {
> put1, err := elasticSearchClient.Index().
> Index(RegisterIndex).
> Type(RegisterDocType).
> BodyJson(reg).
> Do(elasticSearchContext)
> if err != nil {
> log.Println("Failed to store register entry, ", err.Error())
> return err
> }
> log.Println("Indexed", put1.Id, "to index", put1.Index, "type \n", put1.Type)
> doc, err := elasticSearchClient.Get().Index(put1.Index).Type(put1.Type).Id(put1.Id).Do(elasticSearchContext)
> if err != nil {
> log.Println("testing log ->", err)
> }
> log.Println("testing log err -> ", err)
> log.Println("testing log doc -> ", doc)
> } else {
> log.Println("Registration exists, skipped")
> // TODO: check and remove multiple records and store new one.
> }
> return err
> }

```

Log Dumped:

> 2018/06/14 12:39:11 -\> register  
> 2018/06/14 12:39:11 register info----\> {HLRCALLP-01 RegSyveOS-nokiahsshlr01 hlrcallp 2a00:8a00:a000:4000:0:0:c0a8:4616}  
> 2018/06/14 12:39:11 Indexed AWP9IHFlkjFB93J3Ns4Y to index register type  
> register  
> 2018/06/14 12:39:11 **testing log err -\>**   
> 2018/06/14 12:39:11 **testing log doc -\> &{register register AWP9IHFlkjFB93J3Ns4Y 0xc4206a2740 0xc42061d3a0 true map[] }**  
> 2018/06/14 12:39:11 \<- register

I able to see TRUE here. But when see actually the data it is empty.

> root@nhss01vm01oam02\> curl -XGET [http://localhost:9200/register/register/AWP9IHFlkjFB93J3Ns4Y](http://localhost:9200/register/register/AWP9IHFlkjFB93J3Ns4Y)  
> {"\_index":"register","\_type":"register","\_id":"AWP9IHFlkjFB93J3Ns4Y","found":false}

```
> root@nhss01vm01oam02> curl -XPOST 'localhost:9200/register/_search?pretty' -d '
> {
> "query": { "match_all": {} }
> }'
> {
> "took" : 2,
> "timed_out" : false,
> "_shards" : {
> "total" : 5,
> "successful" : 5,
> "failed" : 0
> },
> "hits" : {
> "total" : 0,
> "max_score" : null,
> "hits" : []
> }
> }
> 
> root@nhss01vm01oam02> curl -X GET "localhost:9200/register/_mapping/"
> {"register":{"mappings":{"register":{"properties":{"Address":{"type":"ip"},"NodeName":{"type":"keyword"},"NodeType":{"type":"keyword"},"Uuid":{"type":"keyword"}}}}}}root@nhss01vm01oam02>

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 14, 2018, 7:38am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/13 "2018-06-14T07:38:58Z")

</div>

Here you are most likely sending an empty JSON in `reg` IMO.

Which means that elasticsearch is skipping it as there is nothing to index.

---

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 14, 2018, 9:51am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/14 "2018-06-14T09:51:49Z")

</div>

No, I just tried to print in the same fucntion itself and below are the logs. here 'reg-info' is the one inside the function call.

> ```
> > 
> > func saveRegisterInfo(reg RegisterInfo) (err error) {
> > log.Println("reg-info ->", reg)
> > if !registerExists(reg) {
> > put1, err := elasticSearchClient.Index().
> > Index(RegisterIndex).
> > Type(RegisterDocType).
> > BodyJson(reg).
> > Do(elasticSearchContext)
> > if err != nil {
> > log.Println("Failed to store register entry, ", err.Error())
> > return err
> > }
> 
> ```
> 
> 2018/06/14 15:18:16 -\> register  
> 2018/06/14 15:18:16 register info----\> {lavnf-cscf01 Dw1hO5S3 cscf 3a00::10}  
> 2018/06/14 15:18:16 **reg-info -\> {lavnf-cscf01 Dw1hO5S3 cscf 3a00::10}**  
> 2018/06/14 15:18:16 Indexed AWP9shX9lX2VvIMTDcEO to index register type  
> register  
> 2018/06/14 15:18:16 testing log err -\>   
> 2018/06/14 15:18:16 testing log doc -\> &{register register AWP9shX9lX2VvIMTDcEO 0xc4205f7f50 0xc4206432a0 true map }  
> 2018/06/14 15:18:16 \<- register  
> 2018/06/14 15:18:16 Request completed: POST /api/register Register 16.27µs  
> 2018/06/14 15:18:16 \<-- Returning  
> ^C  
> root@lavnf-oam02\> curl -XGET "localhost:9200/register/regsiter/AWP9shX9lX2VvIMTDcEO"  
> {"\_index":"register","\_type":"regsiter","\_id":"AWP9shX9lX2VvIMTDcEO","found":false}root@lavnf-oam02\>

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 14, 2018, 10:06am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/15 "2018-06-14T10:06:20Z")

</div>

Please remember what I told you:

> [@dadoonet](#):
>
> Great. Next time don't use both quotes `>` and code formatting. It's not necessary.

```auto
{lavnf-cscf01 Dw1hO5S3 cscf 3a00::10}

```

Does not look like a correct JSON to me. May be that's just a logger issue though.

I'm afraid I can't help more unless you can answer this:

> [@dadoonet](#):
>
> Is there any way to trace exactly what is sent to elasticsearch when you call you index API from your client? I mean the REST call that is done behind the scene (URL + Body)?

---

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 14, 2018, 10:18am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/16 "2018-06-14T10:18:12Z")

</div>

> [@kish](#):
>
> reg

I understand that you were asking what is the data sent from client to the program. I will try to explain in the logs itself.

Full code from the point program receive from client to till store the data

> func Register(w http.ResponseWriter, req \*http.Request, vars map[string]string) {  
> log.Println("-\> register")  
> defer log.Println("\<- register")
> 
> var reg RegisterInfo  
> err := json.Unmarshal(byte(vars["Body"]), &reg)  
> w.Header().Set("Content-Type", "application/json; charset=UTF-8")  
> if err != nil {  
> w.WriteHeader(http.StatusBadRequest)  
> log.Println("Json unmarshalling failed: ", err.Error())  
> writeError(w, "Json unmarshalling failed: "+err.Error())  
> return  
> }  
> if reg.Address == "" || reg.Uuid == "" || reg.NodeType == "" {  
> log.Println("Missing fields in register input - ", reg)  
> w.WriteHeader(http.StatusBadRequest)  
> writeError(w, "Missing fields in register input, "+err.Error())  
> return  
> }  
> **log.Println("register info----\>", reg)**  
> err = saveRegisterInfo(reg)  
> if err == nil {  
> w.WriteHeader(http.StatusOK)  
> writeSucces(w, "Registered")  
> } else {  
> w.WriteHeader(http.StatusInternalServerError)  
> log.Println("Failed to save register info, " + err.Error())  
> writeError(w, "Failed to save register info, "+err.Error())  
> }  
> // TODO: handle already registered case  
> }  
> func saveRegisterInfo(reg RegisterInfo) (err error) {  
> **log.Println("reg-info -\>", reg)**  
> if !registerExists(reg) {  
> put1, err := elasticSearchClient.Index().  
> Index(RegisterIndex).  
> Type(RegisterDocType).  
> BodyJson(reg).  
> Do(elasticSearchContext)  
> if err != nil {  
> log.Println("Failed to store register entry, ", err.Error())  
> return err  
> }  
> log.Println("Indexed", put1.Id, "to index", put1.Index, "type \n", put1.Type)  
> doc, err := elasticSearchClient.Get().Index(put1.Index).Type(put1.Type).Id(put1.Id).Do(elasticSearchContext)  
> if err != nil {  
> log.Println("testing log -\>", err)  
> }  
> log.Println("testing log err -\> ", err)  
> log.Println("testing log doc -\> ", doc)  
> } else {  
> log.Println("Registration exists, skipped")  
> // TODO: check and remove multiple records and store new one.  
> }  
> return err  
> }

Logs below

> 2018/06/14 15:18:16 --\> Entering  
> 2018/06/14 15:18:16 Request received: POST /api/register Register 2018-06-14 15:18:16.761873558 +0530 IST  
> 2018/06/14 15:18:16 --\> Entering  
> 2018/06/14 15:18:16 Vars received map  
> 2018/06/14 15:18:16 No form elements in request  
> 2018/06/14 15:18:16 \<-- Returning  
> 2018/06/14 15:18:16 --\> Entering  
> 2018/06/14 15:18:16 \<-- Returning  
> 2018/06/14 15:18:16 Authentication Failed: Credentials not set  
> 2018/06/14 15:18:16 -\> register  
> 2018/06/14 15:18:16 **register info** ----\> {lavnf-cscf01 Dw1hO5S3 cscf 3a00::10} -\> **this is the data received from client**  
> 2018/06/14 15:18:16 **reg-info** -\> {lavnf-cscf01 Dw1hO5S3 cscf 3a00::10} -\> **this is the data inside the saveRegisterInfo fucn**  
> 2018/06/14 15:18:16 Indexed AWP9shX9lX2VvIMTDcEO to index register type  
> register  
> 2018/06/14 15:18:16 testing log err -\>   
> 2018/06/14 15:18:16 testing log doc -\> &{register register AWP9shX9lX2VvIMTDcEO 0xc4205f7f50 0xc4206432a0 true map }  
> 2018/06/14 15:18:16 \<- register  
> 2018/06/14 15:18:16 Request completed: POST /api/register Register 16.27µs  
> 2018/06/14 15:18:16 \<-- Returning

The same program works for ipv4 i.e if the reg is {lavnf-cscf01 Dw1hO5S3 cscf 1.2.3.4}

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 14, 2018, 10:37am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/17 "2018-06-14T10:37:44Z")

</div>

Ok. Then if elasticsearch can't index it, it will not give you back an `_id`.

So can you reproduce the problem please with a script that we can easily run in Kibana?

Like:

```auto
DELETE index
PUT index/_doc/1
{
  "foo": "bar"
}
GET index/_search
{
  "query": {
    "match": {
      "foo": "bar"
    }
  }
}

```

Note: please don't use citation to format your code but follow instructions here: [Unable to store the data in index](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/3?u=dadoonet)

---

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 14, 2018, 11:30am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/18 "2018-06-14T11:30:54Z")

</div>

I have never used Kibana. But what i understood from your request is to provide data in curl format. Kindly let me know if missed something.

```
curl -X PUT "localhost:9200/test" -H 'Content-Type: application/json' -d'
{
    "mappings":{
		"type1":{
			"properties":{
				"Uuid":{
					"type":"keyword"
				},
				"NodeType":{
					"type":"keyword"
				},
				"Address":{
					"type":"ip"
				},
				"NodeName":{
					"type":"keyword"
				}
			}
		}
	}
}'

curl -X PUT "localhost:9200/test" -H 'Content-Type: application/json' -d'
{
	"NodeName" : "cfx" 
	"Uuid" : "yuidje" 
	"NodeType" : "cscf"
	"Address" : "2a00:8a00:a000:4000:0:0:a67:5c16"
}'

```

But when i tried on my setup it is work as expected. Data is getting stored.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 14, 2018, 11:40am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/19 "2018-06-14T11:40:37Z")

</div>

What if you add the type like this?

```auto
curl -X PUT "localhost:9200/test/type1" -H 'Content-Type: application/json' -d'
{
	"NodeName" : "cfx" 
	"Uuid" : "yuidje" 
	"NodeType" : "cscf"
	"Address" : "2a00:8a00:a000:4000:0:0:a67:5c16"
}'

```

---

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 14, 2018, 11:43am UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/20 "2018-06-14T11:43:47Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> curl -X PUT "localhost:9200/test/type1" -H 'Content-Type: application/json' -d' { "NodeName" : "cfx" "Uuid" : "yuidje" "NodeType" : "cscf" "Address" : "2a00:8a00:a000:4000:0:0:a67:5c16" }'

Actually it is working with below format. In my post i missed the /type/doc\_numer.

```
root@lavnf-oam02> curl -X PUT "localhost:9200/test/type1/3" -H 'Content-Type: application/json' -d'
{
"NodeName" : "cfx" ,
"Uuid" : "yuidje" ,
"NodeType" : "cscf",
"Address" : "2a00:8a00:a000:4000:0:0:a67:5c16"
}'

```

---

<div class="post-metadata">

**Author:** ![kish](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kish](https://discuss.elastic.co/u/kish)\
**Post date:** [June 14, 2018, 2:22pm UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/21 "2018-06-14T14:22:56Z")

</div>

I found the solution atleast working fine for me.  
I am using the indexname & indextype same like register/register. But when i changed to different names say like register/registerx, then it is working as expected.

Not sure how it is related but seems to an issue.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 14, 2018, 3:04pm UTC](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332/22 "2018-06-14T15:04:24Z")

</div>

Again, if you can reproduce from scratch we can help. Here it's hard.  
I can just tell that's probably related to the mapping but this is a wild guess.

[Next page](https://discuss.elastic.co/t/unable-to-store-the-data-in-index/135332.md?page=2)
