# Trim all text fields

**URL:** <https://discuss.elastic.co/t/trim-all-text-fields/191630>\
**Category:** Elasticsearch\
**Created:** [July 22, 2019, 11:53am UTC](https://discuss.elastic.co/t/trim-all-text-fields/191630 "2019-07-22T11:53:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayala](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Ayala](https://discuss.elastic.co/u/Ayala)\
**Post date:** [July 22, 2019, 11:53am UTC](https://discuss.elastic.co/t/trim-all-text-fields/191630/1 "2019-07-22T11:53:05Z")

</div>

Hi,  
I would like all saved text fields to be trimmed, for all indexes, such that the leading and end spaces will be removed.  
I am using Java API for indexing documents etc.

Not sure how to use the ingest processors, and in any case, I would not like to specify each field in the configured processor.

As for analyzers, this is an option, but would like then to allow for taking an existing analyzer, and "inheriting" it, by only changing the behavior to remove the leading and end spaces.

Any suggestions?

---

<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:** [August 19, 2019, 11:53am UTC](https://discuss.elastic.co/t/trim-all-text-fields/191630/2 "2019-08-19T11:53:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
