【发布时间】:2014-06-14 22:22:27
【问题描述】:
我一直在尝试使用弹性搜索标记器获取三元组。我在http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-ngram-tokenizer.html 和http://blog.qbox.io/multi-field-partial-word-autocomplete-in-elasticsearch-using-ngrams 学习了教程
遵循这些文档并使用
测试分析器curl 'localhost:9200/test/_analyze?pretty=1&analyzer=my_ngram_analyzer' -d 'FC Schalke 04'
产生像# FC, Sc, Sch, ch, cha, ha, hal, al, alk, lk, lke, ke, 04这样的nGrams
而我想要的是全字三元组
例如,the quick red fox jumps over the lazy brown dog 的三元组将是。
the quick red
quick red fox
red fox jumps
fox jumps over
jumps over the
over the lazy
the lazy brown
lazy brown dog
简而言之,如何使用 elasticsearch 创建像上面这样的 trgrams
【问题讨论】:
标签: curl lucene elasticsearch n-gram