1. 程式人生 > >es 分詞器

es 分詞器

課程大綱

1、什麼是分詞器

切分詞語,normalization(提升recall召回率)

給你一段句子,然後將這段句子拆分成一個一個的單個的單詞,同時對每個單詞進行normalization(時態轉換,單複數轉換),分瓷器
recall,召回率:搜尋的時候,增加能夠搜尋到的結果的數量

character filter:在一段文字進行分詞之前,先進行預處理,比如說最常見的就是,過濾html標籤(<span>hello<span> --> hello),& --> and(I&you --> I and you)
tokenizer:分詞,hello you and me --> hello, you, and, me
token filter:lowercase,stop word,synonymom,dogs --> dog,liked --> like,Tom --> tom,a/the/an --> 幹掉,mother --> mom,small --> little

一個分詞器,很重要,將一段文字進行各種處理,最後處理好的結果才會拿去建立倒排索引

2、內建分詞器的介紹

Set the shape to semi-transparent by calling set_trans(5)

standard analyzer:set, the, shape, to, semi, transparent, by, calling, set_trans, 5(預設的是standard)
simple analyzer:set, the, shape, to, semi, transparent, by, calling, set, trans
whitespace analyzer:Set, the, shape, to, semi-transparent, by, calling, set_trans(5)
language analyzer(特定的語言的分詞器,比如說,english,英語分詞器):set, shape, semi, transpar, call, set_tran, 5