# Proper way to tokenize filenames with periods

**URL:** <https://discuss.elastic.co/t/proper-way-to-tokenize-filenames-with-periods/21914>\
**Category:** Elasticsearch\
**Created:** [January 29, 2015, 10:43pm UTC](https://discuss.elastic.co/t/proper-way-to-tokenize-filenames-with-periods/21914 "2015-01-29T22:43:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevins/32/946_2.png) [@kevins](https://discuss.elastic.co/u/kevins)\
**Post date:** [January 29, 2015, 10:43pm UTC](https://discuss.elastic.co/t/proper-way-to-tokenize-filenames-with-periods/21914/1 "2015-01-29T22:43:45Z")

</div>

Sample text inside a document field:

> 

What I am trying to do is queries such as:

"jquery" (works)  
"jquery.min.js" (works too)  
"jquery.min" (does NOT work)

How can I properly tokenize the above string so that I can search using all  
three of those query strings?

My current index configuration:

{

"settings":{

"number\_of\_shards" : 5,

"number\_of\_replicas" : 0,

"analysis":{

```
            "filter" : {

                "code_filter" : {

                   "type" : "word_delimiter",

                   "type_table": [". => ALPHA", "- => ALPHA"]

               }   

            },

            "analyzer" : {

                "my_ngram_analyzer" : {

                    "tokenizer" : "my_ngram_tokenizer", 

```

"filter" : ["lowercase", "code\_filter"]

```
                }

            },

            "tokenizer" : {

                "my_ngram_tokenizer" : {

                    "type" : "nGram",

                    "min_gram" : "3",

                    "max_gram" : "20",

                    "token_chars": ["letter", "digit"]

                }

            }

        }

```

}

}

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/77e2555a-c41d-4713-bb64-1c757bb5ff5f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/77e2555a-c41d-4713-bb64-1c757bb5ff5f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:35am UTC](https://discuss.elastic.co/t/proper-way-to-tokenize-filenames-with-periods/21914/2 "2017-07-06T00:35:48Z")

</div>


