# Is it possible to map \_all as a multifield?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-map--all-as-a-multifield/11065>\
**Category:** Elasticsearch\
**Created:** [March 7, 2013, 8:23pm UTC](https://discuss.elastic.co/t/is-it-possible-to-map--all-as-a-multifield/11065 "2013-03-07T20:23:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)\
**Post date:** [March 7, 2013, 8:23pm UTC](https://discuss.elastic.co/t/is-it-possible-to-map--all-as-a-multifield/11065/1 "2013-03-07T20:23:30Z")

</div>

Hello,

Is it possible to map \_all as a multifield so that token stream which goes  
into it would go into another field with different analyzer?

In more general case, is it possible to have a multifield which indexes its  
data into another multifield so I could have dozens of fields channeling  
its data into a multifield which then channels it into two multifields of  
its own

for example I want to specify one multifield mapping for a field which  
would channel data into stemmed and shingled multifields

I know I can do it by specifying multiple fields in the original multifield  
but with several hundreds fields in my mappings I am already having hard  
time managing it.

Any other approaches? I am not very eager to do templates as I would prefer  
explicit and non-dynamic mapping but I may try it if there is no other  
alternatives

--  
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:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 7, 2013, 9:03pm UTC](https://discuss.elastic.co/t/is-it-possible-to-map--all-as-a-multifield/11065/2 "2013-03-07T21:03:04Z")

</div>

You should leave \_all as it is (it is special to the include\_in\_all flag  
in the mapping) and use your favorite fields as aggregate fields, with  
using the powerful combination of "multi\_field" and "index\_name".

Example is bibliographic data. For my bibliographic mapping, see

> <https://gist.github.com/jprante/5111676>

In this mapping I use many Dublin Core elements as "multichannel"  
aggregation fields, e.g. you can search for a title in \_all, also in  
"dc:creator" (all creators) but also on "xbib:namePersonal" for persons  
or on "xbib:nameCorporate" for corporate names - while in the JSON  
source, there was only one text string passed for indexing.

You can also see how I create non-analyzed tokens by multi\_field for  
faceting.

I hope this helps?

Jörg

Am 07.03.13 21:23, schrieb AlexR:

> Hello,
> 
> Is it possible to map \_all as a multifield so that token stream which  
> goes into it would go into another field with different analyzer?
> 
> In more general case, is it possible to have a multifield which  
> indexes its data into another multifield so I could have dozens of  
> fields channeling its data into a multifield which then channels it  
> into two multifields of its own
> 
> for example I want to specify one multifield mapping for a field which  
> would channel data into stemmed and shingled multifields
> 
> I know I can do it by specifying multiple fields in the original  
> multifield but with several hundreds fields in my mappings I am  
> already having hard time managing it.
> 
> ## Any other approaches? I am not very eager to do templates as I would prefer explicit and non-dynamic mapping but I may try it if there is no other alternatives
> 
> 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:** ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)\
**Post date:** [March 7, 2013, 10:00pm UTC](https://discuss.elastic.co/t/is-it-possible-to-map--all-as-a-multifield/11065/3 "2013-03-07T22:00:25Z")

</div>

Thanks Jörg,

Very helpful. I really liked how you use name spaces and your naming  
conventions! I think I'll learn from it 🙂 will spend some time on it!

I do understand basic multifield mapping concept and use it extensively may  
be I missed something but  
I was just wondering if there is any way to make mapping more concise. If I  
take time to declare a hundred of fields as multifield so I can combine  
them together, I would love to not to have to do it 3 times once for  
stemmed another for shingled and another for something else

Alex

On Thursday, March 7, 2013 4:03:04 PM UTC-5, Jörg Prante wrote:

> You should leave \_all as it is (it is special to the include\_in\_all flag  
> in the mapping) and use your favorite fields as aggregate fields, with  
> using the powerful combination of "multi\_field" and "index\_name".
> 
> Example is bibliographic data. For my bibliographic mapping, see  
> [bibliographicmapping.json · GitHub](https://gist.github.com/jprante/5111676)
> 
> In this mapping I use many Dublin Core elements as "multichannel"  
> aggregation fields, e.g. you can search for a title in \_all, also in  
> "dc:creator" (all creators) but also on "xbib:namePersonal" for persons  
> or on "xbib:nameCorporate" for corporate names - while in the JSON  
> source, there was only one text string passed for indexing.
> 
> You can also see how I create non-analyzed tokens by multi\_field for  
> faceting.
> 
> I hope this helps?
> 
> Jörg
> 
> Am 07.03.13 21:23, schrieb AlexR:
> 
> > Hello,
> > 
> > Is it possible to map \_all as a multifield so that token stream which  
> > goes into it would go into another field with different analyzer?
> > 
> > In more general case, is it possible to have a multifield which  
> > indexes its data into another multifield so I could have dozens of  
> > fields channeling its data into a multifield which then channels it  
> > into two multifields of its own
> > 
> > for example I want to specify one multifield mapping for a field which  
> > would channel data into stemmed and shingled multifields
> > 
> > I know I can do it by specifying multiple fields in the original  
> > multifield but with several hundreds fields in my mappings I am  
> > already having hard time managing it.
> > 
> > ## Any other approaches? I am not very eager to do templates as I would prefer explicit and non-dynamic mapping but I may try it if there is no other alternatives
> > 
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > 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:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 7, 2013, 10:13pm UTC](https://discuss.elastic.co/t/is-it-possible-to-map--all-as-a-multifield/11065/4 "2013-03-07T22:13:20Z")

</div>

Note, my namespace prefix use is similar to JSON-LD, but I need to  
experiment with it, it should be something like in

> <https://gist.github.com/jprante/4232257>

You are right that writing mapping should be possible in a more concise  
way. But then, you write a good mapping only once. So I think you can  
live with it. Since a recent ES version you can also use JSON comments  
/\*... \*/ in your mapping JSON now for explaining non-obvious things  
(which I couldn't back in mid 2012).

Jörg

Am 07.03.13 23:00, schrieb AlexR:

> Very helpful. I really liked how you use name spaces and your naming  
> conventions! I think I'll learn from it 🙂 will spend some time on it!
> 
> I do understand basic multifield mapping concept and use it  
> extensively may be I missed something but  
> I was just wondering if there is any way to make mapping more concise.  
> If I take time to declare a hundred of fields as multifield so I can  
> combine them together, I would love to not to have to do it 3 times  
> once for stemmed another for shingled and another for something else

--  
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:47am UTC](https://discuss.elastic.co/t/is-it-possible-to-map--all-as-a-multifield/11065/5 "2017-07-06T02:47:42Z")

</div>


