# Faceting for full string

**URL:** <https://discuss.elastic.co/t/faceting-for-full-string/14109>\
**Category:** Elasticsearch\
**Created:** [October 25, 2013, 8:53am UTC](https://discuss.elastic.co/t/faceting-for-full-string/14109 "2013-10-25T08:53:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Peregudov](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alexander\_Peregudov](https://discuss.elastic.co/u/Alexander_Peregudov)\
**Post date:** [October 25, 2013, 8:53am UTC](https://discuss.elastic.co/t/faceting-for-full-string/14109/1 "2013-10-25T08:53:47Z")

</div>

Example:  
I have the a CSV log with user queries. Fields are:  
State  
Query

This CSV was indexed by Logstash with CSV plugin into ES index. I'm using  
Facetview [https://github.com/okfn/facetview/](https://github.com/okfn/facetview/) JS library to view results.  
But Facetview use terms, not string. So, I can see  
"iPhone", "4", "4g", "5" for Query filed column  
and "North", "South', "Carolina" for State field column  
as separate results in facet.

Is it possible to do facet for full exact string and see "iPhone  
4", "iPhone 4g", "iPhone 5" for Query field and "North Carolina", "South  
Carolina" for State field.

JS lib:

> <https://github.com/okfn/facetview/blob/master/jquery.facetview.js>

Thank You!

--  
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:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [October 25, 2013, 11:49am UTC](https://discuss.elastic.co/t/faceting-for-full-string/14109/2 "2013-10-25T11:49:17Z")

</div>

Hi Alexander

You can use multi\_fields to index the same field in different ways:

1. as {"index": "analyzed"} for search
2. as {"index": "not\_analyzed"} for faceting / sorting

Note: faceting on string fields can be very memory intensive. You don't  
want to do this on high cardinality fields as it is likely that you will  
run out memory as your dataset grows

On 25 October 2013 10:53, Alexander Peregudov \<[alexander.peregudov@gmail.com](mailto:alexander.peregudov@gmail.com)

> wrote:

> Example:  
> I have the a CSV log with user queries. Fields are:  
> State  
> Query
> 
> This CSV was indexed by Logstash with CSV plugin into ES index. I'm using  
> Facetview [GitHub - okfn/facetview: FacetView is a pure javascript frontend for ElasticSearch.](https://github.com/okfn/facetview/) JS library to view results.  
> But Facetview use terms, not string. So, I can see  
> "iPhone", "4", "4g", "5" for Query filed column  
> and "North", "South', "Carolina" for State field column  
> as separate results in facet.
> 
> Is it possible to do facet for full exact string and see "iPhone  
> 4", "iPhone 4g", "iPhone 5" for Query field and "North Carolina", "South  
> Carolina" for State field.
> 
> JS lib:  
> [https://github.com/okfn/facetview/blob/master/jquery.facetview.js](https://github.com/okfn/facetview/blob/master/jquery.facetview.js)
> 
> Thank You!
> 
> --  
> 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:10am UTC](https://discuss.elastic.co/t/faceting-for-full-string/14109/3 "2017-07-06T02:10:37Z")

</div>


