我在 elasticsearch 中索引了示例文檔并嘗試使用模糊查詢進行搜索。但是在使用 Java 模糊查詢 api 進行搜索時沒有得到任何結果。請找到我下面的映射腳本:PUT productcatalog { "settings": { "analysis": { "analyzer": { "attr_analyzer": { "type": "custom", "tokenizer": "letter", "char_filter": [ "html_strip" ], "filter": ["lowercase", "asciifolding", "stemmer_minimal_english"] } }, "filter" : { "stemmer_minimal_english" : { "type" : "stemmer", "name" : "minimal_english" } } } }, "mappings": { "doc": { "properties": { "values": { "type": "text", "analyzer": "attr_analyzer" }, "catalog_type": { "type": "text" }, "catalog_id":{ "type": "long" } } } }}請找到我的示例數據。PUT productcatalog/doc/1{ "catalog_id" : "343", "catalog_type" : "series", "values" : "Activa Rooftop, valves, VG3000, VG3000FS, butterfly, ball"}PUT productcatalog/doc/2{ "catalog_id" : "12717", "catalog_type" : "product", "values" : "Activa Rooftop, valves"}請找到我的搜索腳本:GET productcatalog/_search{ "query": { "match" : { "values" : { "query" : " activa rooftop VG3000", "operator" : "and", "boost": 1.0, "fuzziness": 2, "prefix_length": 0, "max_expansions": 100 } } }}
ElasticSearch - 模糊搜索 java api 結果不正確
慕婉清6462132
2021-10-28 15:51:31