# Facets are whitespaced tokenized even they are indexed as not analyzed

**URL:** https://discuss.elastic.co/t/facets-are-whitespaced-tokenized-even-they-are-indexed-as-not-analyzed/12203
**Category:** Elasticsearch
**Created:** [May 31, 2013, 8:15am UTC](https://discuss.elastic.co/t/facets-are-whitespaced-tokenized-even-they-are-indexed-as-not-analyzed/12203 "2013-05-31T08:15:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![TunaVargi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tunavargi/32/2306_2.png) [@TunaVargi](https://discuss.elastic.co/u/TunaVargi)
#### Post date: [May 31, 2013, 8:15am UTC](https://discuss.elastic.co/t/facets-are-whitespaced-tokenized-even-they-are-indexed-as-not-analyzed/12203/1 "2013-05-31T08:15:41Z")

</div>

Hi,  
Below you can see my mapping.  
My destination\_facets field is whitespace tokenized even its indexed as  
not\_analyzed, Any ideas ?  
{  
"mappings": {  
"hotel": {  
'properties': {  
"name": {  
"type": "string",  
"analyzer": "str\_index\_analyzer"},

```
                "destination": {'properties': {'en': {
                    "type": "string",
                    "analyzer": "str_index_analyzer"}}},

                "country": {"properties": {"en": {
                    "type": "string",
                    "analyzer": "str_index_analyzer"}}},
                "destination_facets": {"properties": {"en": {
                    "type": "string",
                    "index": "not_analyzed"
                }}}
            }
        }
    },
    "settings": {
        "analysis": {
            "analyzer": {
                "str_index_analyzer": {
                    "tokenizer": "keyword",
                    "filter": ["lowercase", "substring", "whitespace"]
                }
            },
            "filter": {
                "substring": {
                    "type": "edgeNGram",
                    "min_gram": 3,
                    "max_gram": 20,
                }
            }
        }
    }
}

```

--  
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: ![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: [May 31, 2013, 8:38am UTC](https://discuss.elastic.co/t/facets-are-whitespaced-tokenized-even-they-are-indexed-as-not-analyzed/12203/2 "2013-05-31T08:38:57Z")

</div>

I prefer to separate index settings than mappings.

So I often use the PutMapping API.

Did you try it?

If it's not working, can you create a full curl recreation and Gist it?

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

Le 31 mai 2013 à 10:15, TunaVargı [tuna40@gmail.com](mailto:tuna40@gmail.com) a écrit :

> Hi,  
> Below you can see my mapping.  
> My destination\_facets field is whitespace tokenized even its indexed as not\_analyzed, Any ideas ?  
> {  
> "mappings": {  
> "hotel": {  
> 'properties': {  
> "name": {  
> "type": "string",  
> "analyzer": "str\_index\_analyzer"},
> 
> ```
> "destination": {'properties': {'en': {
> "type": "string",
> "analyzer": "str_index_analyzer"}}},
> 
> "country": {"properties": {"en": {
> "type": "string",
> "analyzer": "str_index_analyzer"}}},
> "destination_facets": {"properties": {"en": {
> "type": "string",
> "index": "not_analyzed"
> }}}
> }
> }
> },
> "settings": {
> "analysis": {
> "analyzer": {
> "str_index_analyzer": {
> "tokenizer": "keyword",
> "filter": ["lowercase", "substring", "whitespace"]
> }
> },
> "filter": {
> "substring": {
> "type": "edgeNGram",
> "min_gram": 3,
> "max_gram": 20,
> }
> }
> }
> }
> }
> 
> ```
> 
> --  
> 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: ![TunaVargi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tunavargi/32/2306_2.png) [@TunaVargi](https://discuss.elastic.co/u/TunaVargi)
#### Post date: [May 31, 2013, 9:30am UTC](https://discuss.elastic.co/t/facets-are-whitespaced-tokenized-even-they-are-indexed-as-not-analyzed/12203/3 "2013-05-31T09:30:08Z")

</div>

How should I set the filter edgeNGram tokenizer while using PutMapping API..

31 Mayıs 2013 Cuma 11:38:57 UTC+3 tarihinde David Pilato yazdı:

> I prefer to separate index settings than mappings.
> 
> So I often use the PutMapping API.
> 
> Did you try it?
> 
> If it's not working, can you create a full curl recreation and Gist it?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 31 mai 2013 à 10:15, TunaVargı \<[tun...@gmail.com](mailto:tun...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Hi,  
> Below you can see my mapping.  
> My destination\_facets field is whitespace tokenized even its indexed as  
> not\_analyzed, Any ideas ?  
> {  
> "mappings": {  
> "hotel": {  
> 'properties': {  
> "name": {  
> "type": "string",  
> "analyzer": "str\_index\_analyzer"},
> 
> ```
> "destination": {'properties': {'en': {
> "type": "string",
> "analyzer": "str_index_analyzer"}}},
> 
> "country": {"properties": {"en": {
> "type": "string",
> "analyzer": "str_index_analyzer"}}},
> "destination_facets": {"properties": {"en": {
> "type": "string",
> "index": "not_analyzed"
> }}}
> }
> }
> },
> "settings": {
> "analysis": {
> "analyzer": {
> "str_index_analyzer": {
> "tokenizer": "keyword",
> "filter": ["lowercase", "substring", "whitespace"]
> }
> },
> "filter": {
> "substring": {
> "type": "edgeNGram",
> "min_gram": 3,
> "max_gram": 20,
> }
> }
> }
> }
> }
> 
> ```
> 
> --  
> 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: ![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:33am UTC](https://discuss.elastic.co/t/facets-are-whitespaced-tokenized-even-they-are-indexed-as-not-analyzed/12203/4 "2017-07-06T02:33:39Z")

</div>


