# String is tokenized in terms facet but shouldn't be

**URL:** https://discuss.elastic.co/t/string-is-tokenized-in-terms-facet-but-shouldnt-be/11505
**Category:** Elasticsearch
**Created:** [April 9, 2013, 2:05pm UTC](https://discuss.elastic.co/t/string-is-tokenized-in-terms-facet-but-shouldnt-be/11505 "2013-04-09T14:05:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![marian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marian/32/442_2.png) [@marian](https://discuss.elastic.co/u/marian)
#### Post date: [April 9, 2013, 2:05pm UTC](https://discuss.elastic.co/t/string-is-tokenized-in-terms-facet-but-shouldnt-be/11505/1 "2013-04-09T14:05:02Z")

</div>

Hi!

My mapping contains a property of name "type" with the setting (in Python):

'type': {  
'store': True,  
'type': 'string',  
'_indexed_': '_not\_analyzed_'  
}

when I call the \_mapping URL of ElasticSearch, I get this for the field:

type: {  
type: 'string',  
store: 'yes'  
}

Why doesn't ES show the "indexed" setting? Suspicious...

When I call a facet from this property, I get tokenized values instead of  
the expected multi-word terms containing spaces. It seems as if the field  
is analyzed, despite the settings.

This is how I retrieve the facet:

curl -X POST  
"[http://localhost:9200/offeneskoeln-latest/\_search?pretty=true](http://localhost:9200/offeneskoeln-latest/_search?pretty=true)" -d '  
{  
"query": {  
"query\_string": {  
"query": "_:_"  
}  
},  
"facets": {  
"type": {  
"terms": {  
"field" : "type"  
}  
}  
}  
}'

Here is some output:

"facets" : {  
"type" : {  
"\_type" : "terms",  
"missing" : 0,  
"total" : 100,  
"other" : 0,  
"terms" : [ {  
"term" : "antrag",  
"count" : 37  
}, {  
"term" : "beschlussvorlage",  
"count" : 24  
}, {  
"term" : "sitzungsvorlage",  
"count" : 13  
}, {  
"term" : "bbr",  
"count" : 13  
}, {  
"term" : "anfrage",  
"count" : 5  
}, {  
"term" : "zum",  
"count" : 2  
}, {  
"term" : "versand",  
"count" : 2  
}, {  
"term" : "informationsvorlage",  
"count" : 2  
}, {  
"term" : "mündlicher",  
"count" : 1  
}, {  
"term" : "bericht",  
"count" : 1  
} ]  
}  
}

The original values where e.g. "Beschlussvorlage", "BBR-Sitzungsvorlage",  
"Mündlicher Bericht" etc.

Using ElasticSearch version 0.20.6.

Thanks in advance!

Marian

--  
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: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [April 9, 2013, 2:20pm UTC](https://discuss.elastic.co/t/string-is-tokenized-in-terms-facet-but-shouldnt-be/11505/2 "2013-04-09T14:20:21Z")

</div>

Hey

I think it should be "index":"not\_analyzed" (instead of indexed). Or is it  
converted somewhere in your python script and I misread it?

--Alex

On Tue, Apr 9, 2013 at 4:05 PM, Marian Steinbach \<[marian.steinbach@gmail.com](mailto:marian.steinbach@gmail.com)

> wrote:

> Hi!
> 
> My mapping contains a property of name "type" with the setting (in Python):
> 
> 'type': {  
> 'store': True,  
> 'type': 'string',  
> '_indexed_': '_not\_analyzed_'  
> }
> 
> when I call the \_mapping URL of Elasticsearch, I get this for the field:
> 
> type: {  
> type: 'string',  
> store: 'yes'  
> }
> 
> Why doesn't ES show the "indexed" setting? Suspicious...
> 
> When I call a facet from this property, I get tokenized values instead of  
> the expected multi-word terms containing spaces. It seems as if the field  
> is analyzed, despite the settings.
> 
> This is how I retrieve the facet:
> 
> curl -X POST "  
> [http://localhost:9200/offeneskoeln-latest/\_search?pretty=true](http://localhost:9200/offeneskoeln-latest/_search?pretty=true)" -d '  
> {  
> "query": {  
> "query\_string": {  
> "query": "_:_"  
> }  
> },  
> "facets": {  
> "type": {  
> "terms": {  
> "field" : "type"  
> }  
> }  
> }  
> }'
> 
> Here is some output:
> 
> "facets" : {  
> "type" : {  
> "\_type" : "terms",  
> "missing" : 0,  
> "total" : 100,  
> "other" : 0,  
> "terms" : [ {  
> "term" : "antrag",  
> "count" : 37  
> }, {  
> "term" : "beschlussvorlage",  
> "count" : 24  
> }, {  
> "term" : "sitzungsvorlage",  
> "count" : 13  
> }, {  
> "term" : "bbr",  
> "count" : 13  
> }, {  
> "term" : "anfrage",  
> "count" : 5  
> }, {  
> "term" : "zum",  
> "count" : 2  
> }, {  
> "term" : "versand",  
> "count" : 2  
> }, {  
> "term" : "informationsvorlage",  
> "count" : 2  
> }, {  
> "term" : "mündlicher",  
> "count" : 1  
> }, {  
> "term" : "bericht",  
> "count" : 1  
> } ]  
> }  
> }
> 
> The original values where e.g. "Beschlussvorlage", "BBR-Sitzungsvorlage",  
> "Mündlicher Bericht" etc.
> 
> Using Elasticsearch version 0.20.6.
> 
> Thanks in advance!
> 
> Marian
> 
> --  
> 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: ![marian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marian/32/442_2.png) [@marian](https://discuss.elastic.co/u/marian)
#### Post date: [April 9, 2013, 2:37pm UTC](https://discuss.elastic.co/t/string-is-tokenized-in-terms-facet-but-shouldnt-be/11505/3 "2013-04-09T14:37:34Z")

</div>

Aaah! "Brett vorm Kopf" we say where I come from.

Thank you very much! Case closed. On to the next...

Marian

Am Dienstag, 9. April 2013 16:20:21 UTC+2 schrieb Alexander Reelsen:

> Hey
> 
> I think it should be "index":"not\_analyzed" (instead of indexed). Or is it  
> converted somewhere in your python script and I misread it?
> 
> --Alex

--  
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:42am UTC](https://discuss.elastic.co/t/string-is-tokenized-in-terms-facet-but-shouldnt-be/11505/4 "2017-07-06T02:42:01Z")

</div>


