# Attach analyzers at index time

**URL:** https://discuss.elastic.co/t/attach-analyzers-at-index-time/6814
**Category:** Elasticsearch
**Created:** [February 27, 2012, 8:50am UTC](https://discuss.elastic.co/t/attach-analyzers-at-index-time/6814 "2012-02-27T08:50:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Lior\_Cohen\_barnea](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@Lior\_Cohen\_barnea](https://discuss.elastic.co/u/Lior_Cohen_barnea)
#### Post date: [February 27, 2012, 8:50am UTC](https://discuss.elastic.co/t/attach-analyzers-at-index-time/6814/1 "2012-02-27T08:50:54Z")

</div>

Hi all,

I am trying to attach an analyzer to a field at index time instead of  
mapping an analyzer to a field statically,

For example - I want to index documents both in English and French and  
I want to decide on the fly which analyzer to use when indexing the  
document.

Can it be done with Jason message or by Lucene query ?

Thanks,

Lior.

---

<div class="post-metadata">

### Author: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [February 27, 2012, 11:45am UTC](https://discuss.elastic.co/t/attach-analyzers-at-index-time/6814/2 "2012-02-27T11:45:00Z")

</div>

Hi Lior

> I am trying to attach an analyzer to a field at index time instead of  
> mapping an analyzer to a field statically,

> For example - I want to index documents both in English and French and  
> I want to decide on the fly which analyzer to use when indexing the  
> document.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

clint

---

<div class="post-metadata">

### Author: ![Lior\_Cohen\_barnea](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@Lior\_Cohen\_barnea](https://discuss.elastic.co/u/Lior_Cohen_barnea)
#### Post date: [February 27, 2012, 1:08pm UTC](https://discuss.elastic.co/t/attach-analyzers-at-index-time/6814/3 "2012-02-27T13:08:17Z")

</div>

Thanks Clint, got the idea.

On Feb 27, 1:45 pm, Clinton Gormley [cl...@traveljury.com](mailto:cl...@traveljury.com) wrote:

> Hi Lior
> 
> > I am trying to attach an analyzer to a field at index time instead of  
> > mapping an analyzer to a field statically,
> 
> > For example - I want to index documents both in English and French and  
> > I want to decide on the fly which analyzer to use when indexing the  
> > document.
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/analyzer-field.html)
> 
> clint

---

<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:38am UTC](https://discuss.elastic.co/t/attach-analyzers-at-index-time/6814/4 "2017-07-06T03:38:04Z")

</div>


