我已經使用Edge N gram.i編制了我的技術數據庫的索引,我使用了以下代碼。彈性搜索自動完成,用空間搜索創建問題
{"settings": {
"analysis": {
"analyzer": {
"standardWithEdgeNGram": {
"tokenizer": "standard",
"filter": ["lowercase", "edgeNGram"]
}
},
"tokenizer": {
"standard": {
"type": "standard"
}
},
"filter": {
"lowercase": {
"type": "lowercase"
},
"edgeNGram": {
"type": "edgeNGram",
"min_gram": 1,
"max_gram": 15,
"token_chars": ["letter", "digit","punctuation","whitespace","symbol"]
}
}
}},"mappings": { "technologies":{
"properties":{
"application": {
"type" : "string",
"index": "not_analyzed"
}
}
}
}
與此代碼我能夠搜索內容。但我的問題是當我搜索內容與空間它不會產生所需的結果。
例如 如果我搜索「紅寶石」我得到的輸出爲「軌道上的紅寶石」,但如果我搜索「紅寶石SER」它會給出輸出,如「軌道上的紅寶石」,「Windows服務器」等,但它應該基本上給我任何輸出.... plzzz幫助