Solr拼寫檢查(spellCheck)配置和使用

2022-01-22 04:37:44 字數 555 閱讀 9776

solr具有拼寫檢查的功能,您只需修改solr的配置檔案(solrconfig.xml)中spellcheck部分:

textspell

solr.filebasedspellchecker

file

spellings.txt

utf-8

spellcheckerfile

其中spelling.txt中,如果想加入漢字,確保為utf-8 無bom編碼。

樣例(一行乙個單詞)如下:

pizza

history

李克華http://localhost:1985/solr/spell?spellcheck.q=%e6%9d%8e%e5%85%8b%e8%af%9d&spellcheck=true&spellcheck.dictionary=file&spellcheck.build=true

檢索結果:

其中檢索的關鍵字 在客戶端需要用encodeuri編碼一下。

Solr之拼寫檢查。

首先配置solrconfig.xml檔案可能已經有這兩個元素 如果沒有新增即可 需要根據我們自己的系統環境做些適當的修改。使用solrj時也同樣加入引數就可以。solrquery query new solrquery query.set q query.set qt spell queryresp...

SOLR拼寫檢查相關

6.8相似匹配 在我們使用網頁搜尋時,會注意到每乙個結果都包含乙個 相似頁面 鏈結,單擊該鏈結,就會發布另乙個搜尋請求,查詢出與起初結果類似的文件。solr 使用 morelikethiscomponent mlt 和 morelikethishandler 實現了一樣的功能。如上所述,mlt 是與...

solr拼寫檢查 spellCheck

拼寫檢查 spellcheck 首先配置 solrconfig.xml,檔案可能已經有這兩個元素 如果沒有新增即可 需要根據我們自己的系統環境做些適當的修改。default name spellchecker true false false 1spellcheck 配置完之後,需要重新建遍索引才能...