# Pre processing a field and pushing it back into the input stream

**URL:** <https://discuss.elastic.co/t/pre-processing-a-field-and-pushing-it-back-into-the-input-stream/14829>\
**Category:** Elasticsearch\
**Created:** [December 12, 2013, 1:39am UTC](https://discuss.elastic.co/t/pre-processing-a-field-and-pushing-it-back-into-the-input-stream/14829 "2013-12-12T01:39:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rinaldo\_DiGiorgio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rinaldo_digiorgio/32/1917_2.png) [@Rinaldo\_DiGiorgio](https://discuss.elastic.co/u/Rinaldo_DiGiorgio)\
**Post date:** [December 12, 2013, 1:39am UTC](https://discuss.elastic.co/t/pre-processing-a-field-and-pushing-it-back-into-the-input-stream/14829/1 "2013-12-12T01:39:57Z")

</div>

Hi there,

I think I know the answer. I read the docs and it seems to indicate that I  
would need to make it a nested query. I thought I would ask so I could  
gain some confidence that I am starting to read and understand the  
documentation and terminology.

I have records like this

- a: Brave New World
- b: Matrix
- c:1,2,3,4,5,6|0|The Selfish Gene
- d: alpha
- e: Mac
- f: Safari
- g: 7
- h: en

I have millions of records like this. I want to count the values in c as  
individual values

- a: Brave New World
- b: Matrix
- c:3,5|0|The Selfish Gene
- d: alpha
- e: Mac
- f: Safari
- g: 7
- h: en

the answer would be

1,1  
2,1  
_3,2_  
4,1  
_5,2_  
6,1

I know how to get the c records and then extract the values myself by doing  
two splits putting them into an array and sorting it.

What I would like to do is not do that work because I have many json  
objects with the same property. Yes I can create an individual entry for  
each one. I am asking can I parse a match and push it back on the output  
stream so that it can be recounted.

Rinaldo

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/533f59a8-1302-4568-9c8e-842ae0a2f95e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/533f59a8-1302-4568-9c8e-842ae0a2f95e%40googlegroups.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:01am UTC](https://discuss.elastic.co/t/pre-processing-a-field-and-pushing-it-back-into-the-input-stream/14829/2 "2017-07-06T02:01:50Z")

</div>

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


