First, you need to ask yourself if you really need to break complex words. Consider a simpler approach, for example, using edge n-grams to hit the leading or trailing edges. This would have the side effect of mildly striking at fragments such as "ey", but perhaps that would be acceptable for your situation.
If you need to break connections and want to explicitly index word fragments, you will need to get a list of words. You can download a list of English words, one example here . A list of vocabulary words is used to determine which fragments of compound words are actually the words themselves. This will add the overhead of indexing, so be sure to check it out. An example showing usage here .
If your text is German, consider https://github.com/jprante/elasticsearch-analysis-decompound
source share