# ElasticSearch analyzer for short strings

**URL:** <https://discuss.elastic.co/t/elasticsearch-analyzer-for-short-strings/23147>\
**Category:** Elasticsearch\
**Created:** [April 8, 2015, 9:22am UTC](https://discuss.elastic.co/t/elasticsearch-analyzer-for-short-strings/23147 "2015-04-08T09:22:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![redserpent7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redserpent7/32/467_2.png) [@redserpent7](https://discuss.elastic.co/u/redserpent7)\
**Post date:** [April 8, 2015, 9:22am UTC](https://discuss.elastic.co/t/elasticsearch-analyzer-for-short-strings/23147/1 "2015-04-08T09:22:32Z")

</div>

I am creating an ES application where it should be able to index and search  
file content (pdf, word, txt, etc) and file names where it is possible for  
any file to be indexed.

For the content I use the compact language detector to detect the language  
of the content and assign it to its corresponding content field.

I have no issues with content, yet the problem is with file names. The  
thing is that file names are short and they can be written in any language  
making it hard to detect the language as CLD (or any language detector) do  
not perform well with short strings.

Currently I have configured the following analyzer for file names:

"def\_analyzer":{  
"type":"custom",  
"filter":["word\_delimiter","icu\_normalizer","icu\_folding"],  
"tokenizer":"icu\_tokenizer"  
}

Tested and it works fine most of the time. tried it with many latin  
languages and it was able to get the result correctly most of the times.

The only times that it failed to get correct results is when the file name  
had an acronym in it.

For example, when I search for WinSCP, the top result do not contain the  
files whos names have WinSCP in them. What I get though are files with  
names like Win32 for example.

I believe this is the work of the Word Delimiter token filter as its  
probably splitting WinSCP into Win, S, C and P.

So what I am asking is, what is a good analyzer/filters combination for  
short strings regardless of their language.

--  
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/bfe3d9ee-538e-4d07-9dbd-d029ebd9a7df%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bfe3d9ee-538e-4d07-9dbd-d029ebd9a7df%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:20am UTC](https://discuss.elastic.co/t/elasticsearch-analyzer-for-short-strings/23147/2 "2017-07-06T00:20:55Z")

</div>

Closed on July 6, 2017, 12:20am UTC


