在Elasticsearch我想找到與我的搜索字段相關的相關記錄,如與stackoverflow相關的問題建議。這意味着,匹配搜索結果是靠近一個另一個。如何找到與我的搜索字段在Elasticsearch相關的記錄
比如我搜索「男士鞋」,從以下數據
- 「男士鞋」
- 「女孩的鞋」
- 「男士鞋黑色」
- 「女鞋」
- 「女鞋粉紅色」
- 「女鞋紅色」
- 「男童鞋」
- 「男士鞋灰色」
- 「男士鞋的白色」
- 「男士鞋綠色」
- 「男士鞋」
然後,我怎麼可以得到更多相關的元組項目「男鞋」?我怎樣才能得到與同義詞相關的數據也就是說。男人的鞋子。
在KibanaPOST /atomap/product/_bulk
{"index":{"_id":"1"}}
{"name": "Girl's Shoe"}
{"index":{"_id":"2"}}
{"name": "Men's Shoe"}
{"index":{"_id":"3"}}
{"name": "Women's Shoe"}
{"index":{"_id":"4"}}
{"name": "Women's Shoe pink color"}
{"index":{"_id":"5"}}
{"name": "Women's Shoe red color"}
{"index":{"_id":"6"}}
{"name": "Boy's Shoe"}
{"index":{"_id":"7"}}
{"name": "Men's Shoe red color"}
{"index":{"_id":"8"}}
{"name": "Men's Shoe white color"}
{"index":{"_id":"9"}}
{"name": "Men's Shoe green color"}
{"index":{"_id":"10"}}
{"name": "Men's Shoe gray color"}
{"index":{"_id":"11"}}
{"name": "Men's footwear"}
散裝Inser我試圖與more like this
查詢:
GET /atomap/product/_search
{
"query": {
"more_like_this": {
"like": "Men's shoe",
"min_term_freq": 1,
"min_doc_freq": 1
}
}
}
我的問題是怎樣搜尋相關的字?由於More Like This Query在搜索「男士鞋」時找不到「男士鞋類」。
這是我的索引名稱的錯誤。但我想在第三個位置有'男士鞋',即。 「女鞋」之前 –