Created
May 24, 2012 10:12
-
-
Save duydo/2780649 to your computer and use it in GitHub Desktop.
ElasticSearch - substring search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You have two options: | |
Use ngrams through the ngram token filter: http://www.elasticsearch.org/guide/reference/index-modules/analysis/ngram-tokenfilter.html. See Wikipedia for details: http://en.wikipedia.org/wiki/N-gram | |
Use the compound token filter http://www.elasticsearch.org/guide/reference/index-modules/analysis/compound-word-tokenfilter.html (which I have contributed to Lucene btw.) | |
The ngrams are useful if you cannot provide a dictionary because you don't know what type of documents you have to index. The downside is that they use a lot of space in your indices. So you need to be careful here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment