# Adding new fields showing Error

**URL:** https://discuss.elastic.co/t/adding-new-fields-showing-error/8212
**Category:** Elasticsearch
**Created:** [June 25, 2012, 11:48am UTC](https://discuss.elastic.co/t/adding-new-fields-showing-error/8212 "2012-06-25T11:48:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vijuitech](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vijuitech](https://discuss.elastic.co/u/vijuitech)
#### Post date: [June 25, 2012, 11:48am UTC](https://discuss.elastic.co/t/adding-new-fields-showing-error/8212/1 "2012-06-25T11:48:45Z")

</div>

Hi,  
I have added new field url with the existing JSON

test  
{  
properties{  
.  
.  
.

"url" : { "type" : "string", "store" : "no", "index" :  
"not\_analyzed","omit\_norms" : "true", "omit\_term\_freq\_and\_positions" :  
"true"}

}  
}

For setting up the mapping to all the indices I used,

curl -XPUT [http://localhost:9200/index1/test/\_mapping](http://localhost:9200/index1/test/_mapping)

After running this curl I got

{"error":"ElasticSearchParseException[Failed to derive xcontent  
from ]","status":400}

How can I set the new field(ie url) with the existing Index(ie  
index1)?

Cheers!

Thanks!

George

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [June 25, 2012, 11:52am UTC](https://discuss.elastic.co/t/adding-new-fields-showing-error/8212/2 "2012-06-25T11:52:45Z")

</div>

You did not provide the command with an actual body (the mapping)...

On Mon, Jun 25, 2012 at 1:48 PM, George Viju [vijuitech@gmail.com](mailto:vijuitech@gmail.com) wrote:

> Hi,  
> I have added new field url with the existing JSON
> 
> test  
> {  
> properties{  
> .  
> .  
> .
> 
> "url" : { "type" : "string", "store" : "no", "index" :  
> "not\_analyzed","omit\_norms" : "true", "omit\_term\_freq\_and\_positions" :  
> "true"}
> 
> }  
> }
> 
> For setting up the mapping to all the indices I used,
> 
> curl -XPUT [http://localhost:9200/index1/test/\_mapping](http://localhost:9200/index1/test/_mapping)
> 
> After running this curl I got
> 
> {"error":"ElasticSearchParseException[Failed to derive xcontent  
> from ]","status":400}
> 
> How can I set the new field(ie url) with the existing Index(ie  
> index1)?
> 
> Cheers!
> 
> Thanks!
> 
> George

---

<div class="post-metadata">

### Author: ![vijuitech](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vijuitech](https://discuss.elastic.co/u/vijuitech)
#### Post date: [June 28, 2012, 5:24am UTC](https://discuss.elastic.co/t/adding-new-fields-showing-error/8212/3 "2012-06-28T05:24:03Z")

</div>

Thank you Shay, I am using the JSON Mapping as

{  
"mappings" : {

```
    "test" : {
        "_source" : { "enabled" : false },
         "_routing" : {
                   "required" : true,
                   "path" : "harvestdate"
        		  },

        "properties" : {
        	"infoid" : { "type" : "long", "store" : "yes",

```

"precision\_step" : "0" },  
"productid" : { "type" : "string", "store" : "yes",  
"index" : "not\_analyzed", "omit\_norms" : "true",  
"omit\_term\_freq\_and\_positions" : "true" },  
"saleid" : { "type" : "long", "store" : "yes",  
"precision\_step" : "0" }

```
                       }
                 }
             }

```

1. I am using the Index as index1

2. 

```
I have to add a new field in the JSON and it looks like,

```

{  
"mappings" : {

```
    "test" : {
        "_source" : { "enabled" : false },
         "_routing" : {
                   "required" : true,
                   "path" : "harvestdate"
        		  },

        "properties" : {
        	"infoid" : { "type" : "long", "store" : "yes",

```

"precision\_step" : "0" },  
"productid" : { "type" : "string", "store" : "yes",  
"index" : "not\_analyzed", "omit\_norms" : "true",  
"omit\_term\_freq\_and\_positions" : "true" },  
"saleid" : { "type" : "long", "store" : "yes",  
"precision\_step" : "0" },  
"deal" :{ "type" : "string", "store" : "no",  
"index" : "not\_analyzed","omit\_norms" : "true",  
"omit\_term\_freq\_and\_positions" : "true"}

```
                       }
                 }
             }

```

I am trying to update this mapping with the Index(index1) by using the  
command

curl -XPUT '[http://localhost:9200/index1/test/\_mapping](http://localhost:9200/index1/test/_mapping)' -d '{  
"mappings" : {

```
    "test" : {
        "_source" : { "enabled" : false },
         "_routing" : {
                   "required" : true,
                   "path" : "harvestdate"
        		  },

        "properties" : {
        	"infoid" : { "type" : "long", "store" : "yes",

```

"precision\_step" : "0" },  
"productid" : { "type" : "string", "store" : "yes",  
"index" : "not\_analyzed", "omit\_norms" : "true",  
"omit\_term\_freq\_and\_positions" : "true" },  
"saleid" : { "type" : "long", "store" : "yes",  
"precision\_step" : "0" },  
"deal" :{ "type" : "string", "store" : "no",  
"index" : "not\_analyzed","omit\_norms" : "true",  
"omit\_term\_freq\_and\_positions" : "true"}

```
                       }
                 }
             }'

```

While checking the mapping the mapping it is not Set with the Updated  
Mapping in the Index(index1). What is the error in this curl or  
mapping?

Thanks in Advance!

Cheers!

George

On Jun 25, 4:52 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> You did not provide the command with an actual body (the mapping)...
> 
> On Mon, Jun 25, 2012 at 1:48 PM, George Viju [vijuit...@gmail.com](mailto:vijuit...@gmail.com) wrote:
> 
> > Hi,  
> > I have added new field url with the existing JSON
> 
> > test  
> > {  
> > properties{  
> > .  
> > .  
> > .
> 
> > "url" : { "type" : "string", "store" : "no", "index" :  
> > "not\_analyzed","omit\_norms" : "true", "omit\_term\_freq\_and\_positions" :  
> > "true"}
> 
> > }  
> > }
> 
> > For setting up the mapping to all the indices I used,
> 
> > curl -XPUThttp://localhost:9200/index1/test/\_mapping
> 
> > After running this curl I got
> 
> > {"error":"ElasticSearchParseException[Failed to derive xcontent  
> > from ]","status":400}
> 
> > How can I set the new field(ie url) with the existing Index(ie  
> > index1)?
> 
> > Cheers!
> 
> > Thanks!
> 
> > George

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 3:22am UTC](https://discuss.elastic.co/t/adding-new-fields-showing-error/8212/4 "2017-07-06T03:22:15Z")

</div>


