# Is it is possible to apply mapping on single fields?

**URL:** <https://discuss.elastic.co/t/is-it-is-possible-to-apply-mapping-on-single-fields/7670>\
**Category:** Elasticsearch\
**Created:** [May 12, 2012, 6:40am UTC](https://discuss.elastic.co/t/is-it-is-possible-to-apply-mapping-on-single-fields/7670 "2012-05-12T06:40:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [May 12, 2012, 6:40am UTC](https://discuss.elastic.co/t/is-it-is-possible-to-apply-mapping-on-single-fields/7670/1 "2012-05-12T06:40:52Z")

</div>

Hi

I have following fields:

primaryfileID, jobID, AccountName, alternateIndustry, AddressLine1\_1

I want "AccountName" field not analysed ,rest of remaining fields uses  
analyzer setting,Is it is possible to apply mapping on single field,or need  
to create mapping for rest of field with analyzed.

used mappings:

{  
"primarytype" : {  
"properties" : {  
"AccountName" : {"type" : "string", "index" : "not\_analyzed"},  
}  
}  
}

please help me?

Thanks

---

<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:** [May 12, 2012, 7:43am UTC](https://discuss.elastic.co/t/is-it-is-possible-to-apply-mapping-on-single-fields/7670/2 "2012-05-12T07:43:52Z")

</div>

You can define a mapping with one single field and let the "merge mapping" feature add new fields when the first document is indexed.

But IMHO, it's a bad practice.

My advice is :  
Send a full document to ES  
Get the automatic mapping for this type  
Modify it (modify the field you need)  
Delete the type  
Create the type with the new mapping  
Send your documents

HTH  
David 😉  
Twitter : @dadoonet / @elasticsearchfr

Le 12 mai 2012 à 08:40, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) a écrit :

> Hi
> 
> I have following fields:
> 
> primaryfileID, jobID, AccountName, alternateIndustry, AddressLine1\_1
> 
> I want "AccountName" field not analysed ,rest of remaining fields uses analyzer setting,Is it is possible to apply mapping on single field,or need to create mapping for rest of field with analyzed.
> 
> used mappings:
> 
> {  
> "primarytype" : {  
> "properties" : {  
> "AccountName" : {"type" : "string", "index" : "not\_analyzed"},  
> }  
> }  
> }
> 
> please help me?
> 
> Thanks

---

<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:** [May 15, 2012, 8:05pm UTC](https://discuss.elastic.co/t/is-it-is-possible-to-apply-mapping-on-single-fields/7670/3 "2012-05-15T20:05:32Z")

</div>

No problem with sending mappings just for a single field (or specific  
fields), and relaying on the automatic schema for the rest.

On Sat, May 12, 2012 at 9:40 AM, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:

> Hi
> 
> I have following fields:
> 
> primaryfileID, jobID, AccountName, alternateIndustry, AddressLine1\_1
> 
> I want "AccountName" field not analysed ,rest of remaining fields uses  
> analyzer setting,Is it is possible to apply mapping on single field,or need  
> to create mapping for rest of field with analyzed.
> 
> used mappings:
> 
> {
> 
> ```
> "primarytype" : {
> 
> "properties" : {
> 
> "AccountName" : {"type" : "string", "index" : "not_analyzed"},
> 
> }
> 
> }
> 
> ```
> 
> }
> 
> please help me?
> 
> Thanks

---

<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:28am UTC](https://discuss.elastic.co/t/is-it-is-possible-to-apply-mapping-on-single-fields/7670/4 "2017-07-06T03:28:47Z")

</div>

Closed on July 6, 2017, 3:28am UTC


