# Set analyzer for a field based on field's name specified by a regex?

**URL:** <https://discuss.elastic.co/t/set-analyzer-for-a-field-based-on-fields-name-specified-by-a-regex/13804>\
**Category:** Elasticsearch\
**Created:** [September 30, 2013, 12:12pm UTC](https://discuss.elastic.co/t/set-analyzer-for-a-field-based-on-fields-name-specified-by-a-regex/13804 "2013-09-30T12:12:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadyabhi](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@shadyabhi](https://discuss.elastic.co/u/shadyabhi)\
**Post date:** [September 30, 2013, 12:12pm UTC](https://discuss.elastic.co/t/set-analyzer-for-a-field-based-on-fields-name-specified-by-a-regex/13804/1 "2013-09-30T12:12:38Z")

</div>

Hi all,

As the subject states, is that possible?

I'm sending json documents with various fields like a, b, c, fields.a,  
fields.b, fields.c, d. I want to add a rule in template that sets all  
fields starts with "fields." (or a regex as /fields..\*/ ) as not\_analyzed.

Is that possible in elasticsearch as of now? Please note that "fields"  
is just a field name and it's not a object. Thanks

--  
Regards,  
Abhijeet Rastogi (shadyabhi)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [September 30, 2013, 10:16pm UTC](https://discuss.elastic.co/t/set-analyzer-for-a-field-based-on-fields-name-specified-by-a-regex/13804/2 "2013-09-30T22:16:28Z")

</div>

Look into dynamic templates. You can set the match\_pattern to be regex.

> **[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.

Cheers,

Ivan

On Mon, Sep 30, 2013 at 5:12 AM, Abhijeet Rastogi  
[abhijeet.1989@gmail.com](mailto:abhijeet.1989@gmail.com)wrote:

> Hi all,
> 
> As the subject states, is that possible?
> 
> I'm sending json documents with various fields like a, b, c, fields.a,  
> fields.b, fields.c, d. I want to add a rule in template that sets all  
> fields starts with "fields." (or a regex as /fields..\*/ ) as not\_analyzed.
> 
> Is that possible in elasticsearch as of now? Please note that "fields"  
> is just a field name and it's not a object. Thanks
> 
> --  
> Regards,  
> Abhijeet Rastogi (shadyabhi)
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:14am UTC](https://discuss.elastic.co/t/set-analyzer-for-a-field-based-on-fields-name-specified-by-a-regex/13804/3 "2017-07-06T02:14:11Z")

</div>

Closed on July 6, 2017, 2:14am UTC


