# Multivalued field

**URL:** <https://discuss.elastic.co/t/multivalued-field/9568>\
**Category:** Elasticsearch\
**Created:** [November 5, 2012, 10:23pm UTC](https://discuss.elastic.co/t/multivalued-field/9568 "2012-11-05T22:23:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rogerio\_Pereira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rogerio_pereira/32/2635_2.png) [@Rogerio\_Pereira](https://discuss.elastic.co/u/Rogerio_Pereira)\
**Post date:** [November 5, 2012, 10:23pm UTC](https://discuss.elastic.co/t/multivalued-field/9568/1 "2012-11-05T22:23:13Z")

</div>

Hi,

How elasticsearch handles a multivalued field? Like authors field? The  
content is initially a comma separated list from which I would like to  
split the values and then use in a facet?

--

---

<div class="post-metadata">

**Author:** ![Rogerio\_Pereira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rogerio_pereira/32/2635_2.png) [@Rogerio\_Pereira](https://discuss.elastic.co/u/Rogerio_Pereira)\
**Post date:** [November 5, 2012, 10:41pm UTC](https://discuss.elastic.co/t/multivalued-field/9568/2 "2012-11-05T22:41:08Z")

</div>

It's an array type:

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

Em segunda-feira, 5 de novembro de 2012 20h23min14s UTC-2, Rogerio Pereira  
escreveu:

> Hi,
> 
> How elasticsearch handles a multivalued field? Like authors field? The  
> content is initially a comma separated list from which I would like to  
> split the values and then use in a facet?

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 6, 2012, 3:38am UTC](https://discuss.elastic.co/t/multivalued-field/9568/3 "2012-11-06T03:38:54Z")

</div>

I think I did not understand your concern.

An answer is perhaps to use the \_analyze API to see how ES will break your field into tokens.

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

Does it help?  
Or could you elaborate a bit more?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 5 nov. 2012 à 23:41, Rogerio Pereira [rogerio.araujo@gmail.com](mailto:rogerio.araujo@gmail.com) a écrit :

It's an array type:

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

Em segunda-feira, 5 de novembro de 2012 20h23min14s UTC-2, Rogerio Pereira escreveu:

> Hi,
> 
> How elasticsearch handles a multivalued field? Like authors field? The content is initially a comma separated list from which I would like to split the values and then use in a facet?

--

--

---

<div class="post-metadata">

**Author:** ![Kenneth\_Loafman\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kenneth_loafman_2/32/2224_2.png) [@Kenneth\_Loafman\_2](https://discuss.elastic.co/u/Kenneth_Loafman_2)\
**Post date:** [November 6, 2012, 1:42pm UTC](https://discuss.elastic.co/t/multivalued-field/9568/4 "2012-11-06T13:42:01Z")

</div>

I think I know what he wants. If you can get the frequency (not just  
presence) of the words within the document and you can get the total  
frequency of words within the corpus, then you can use that to get the  
weight of each word and use that to do a statistical comparison of two  
documents to see if they match. Its very fast and can be used for things  
like near-deduplication. You can even do things like set up a medical  
corpus and a legal corpus and figure out reliably where a new document  
belongs.

...Ken

On Mon, Nov 5, 2012 at 9:38 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> I think I did not understand your concern.
> 
> An answer is perhaps to use the \_analyze API to see how ES will break your  
> field into tokens.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html)
> 
> Does it help?  
> Or could you elaborate a bit more?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 5 nov. 2012 à 23:41, Rogerio Pereira [rogerio.araujo@gmail.com](mailto:rogerio.araujo@gmail.com) a  
> écrit :
> 
> It's an array type:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/array-type.html)
> 
> Em segunda-feira, 5 de novembro de 2012 20h23min14s UTC-2, Rogerio Pereira  
> escreveu:
> 
> > Hi,
> > 
> > How elasticsearch handles a multivalued field? Like authors field? The  
> > content is initially a comma separated list from which I would like to  
> > split the values and then use in a facet?
> 
> --
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Rogerio\_Pereira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rogerio_pereira/32/2635_2.png) [@Rogerio\_Pereira](https://discuss.elastic.co/u/Rogerio_Pereira)\
**Post date:** [November 6, 2012, 6:25pm UTC](https://discuss.elastic.co/t/multivalued-field/9568/5 "2012-11-06T18:25:50Z")

</div>

I think you give me a direction David, I just need to split something like  
"Author 1, Author 2" into several terms to use in my facet.

As far I could see the pattern tokenizer can help me to do that instead of  
set an array to my author field.

Em terça-feira, 6 de novembro de 2012 01h39min11s UTC-2, David Pilato  
escreveu:

> I think I did not understand your concern.
> 
> An answer is perhaps to use the \_analyze API to see how ES will break your  
> field into tokens.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html)
> 
> Does it help?  
> Or could you elaborate a bit more?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 5 nov. 2012 à 23:41, Rogerio Pereira \<[rogerio...@gmail.com](mailto:rogerio...@gmail.com)\<javascript:\>\>  
> a écrit :
> 
> It's an array type:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/array-type.html)
> 
> Em segunda-feira, 5 de novembro de 2012 20h23min14s UTC-2, Rogerio Pereira  
> escreveu:
> 
> > Hi,
> > 
> > How elasticsearch handles a multivalued field? Like authors field? The  
> > content is initially a comma separated list from which I would like to  
> > split the values and then use in a facet?
> 
> --

--

---

<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:05am UTC](https://discuss.elastic.co/t/multivalued-field/9568/6 "2017-07-06T03:05:55Z")

</div>


