ElasticSearchおよびPorterystemアナライザー
-
28-10-2019 - |
質問
ElasticSearchを使用して、サイトの検索機能を提供することを検討しています。
私はそれを実験してきましたが、ポーターシステムアナライザーを有効にすることができません(戦いの検索と戦闘が一致するように)。
これが私の入力の実行です。
curl -XPUT localhost:9200/local/ -d'
index :
analysis :
analyzer :
stemming :
type : custom
tokenizer : standard
filter : [standard, lowercase, stop, porterStem]
'
curl -XPUT localhost:9200/local/_mapping -d'{"properties": { "title" : { "analyzer" : "stemming", "type" : "string" }}}'
curl -XPUT localhost:9200/local/article/1 -d'{"title": "Fight for your life"}'
curl -XPUT localhost:9200/local/article/2 -d'{"title": "Fighting for your life"}'
curl -XPUT localhost:9200/local/article/3 -d'{"title": "My dad fought a dog"}'
curl -XPUT localhost:9200/local/article/4 -d'{"title": "Bruno fights Tyson tomorrow"}'
ただし、「ファイト」の検索を実行すると、最初のエントリ(正確な用語が含まれるエントリ)のみが一致します。
curl -XGET localhost:9200/local/_search?q=fight
正しい設定はセットアップされているように見えますが、機能しないようです。
"indices" : {
"local" : {
"aliases" : [ ],
"settings" : {
"index.analysis.analyzer.stemming.type" : "custom",
"index.analysis.analyzer.stemming.tokenizer" : "standard",
"index.analysis.analyzer.stemming.filter.1" : "lowercase",
"index.analysis.analyzer.stemming.filter.0" : "standard",
"index.analysis.analyzer.stemming.filter.3" : "porterStem",
"index.analysis.analyzer.stemming.filter.2" : "stop",
"index.number_of_shards" : "5",
"index.number_of_replicas" : "1"
},
誰かがこの機能を稼働させ、正しい方向に私を向けることができますか?
解決
Snowball Stemmerを使用して、カスタムアナライザーを使用した場合の例の構成があります。なぜElasticSearchが私の用語を見つけていないのか
所属していません StackOverflow