0
我有在冠軍,描述,作者,EAN,ISBN searchs查詢。彈性得到相關的搜索結果
我提升爲冠軍^ 3,筆者^ 2,EAN^100和ISBN^100。
當我用ean命中時,它只返回1個結果。 (ean是一個數字)
ISBN是一個字符串例如。 978-12-1234-123-8我得到了成千上萬的ISBN結果。但是如果碰到了,那麼結果就會稍微高一些。
我正在使用multi_match帶有類型best_fields。
有沒有辦法只得到相關結果?或者我必須自己做?
編輯:
映射:
"product": {
"properties": {
"img": {
"type": "string"
},
"dobrovsky_rating": {
"type": "float"
},
"isbn": {
"type": "string"
},
"saleType": {
"type": "string"
},
"rating": {
"type": "float"
},
"description": {
"analyzer": "hunspell_cs",
"type": "string"
},
"availability": {
"type": "string"
},
"priceDph": {
"type": "long"
},
"title": {
"analyzer": "hunspell_cs",
"type": "string"
},
"url": {
"index": "not_analyzed",
"type": "string"
},
"rating_count": {
"type": "long"
},
"ean": {
"type": "string"
},
"serie": {
"analyzer": "hunspell_cs",
"type": "string"
},
"id": {
"type": "long"
},
"category": {
"analyzer": "hunspell_cs",
"type": "string"
},
"authors": {
"analyzer": "hunspell_cs",
"type": "string"
}
}
數據例如:
Id: 123
Title: Game of Thrones
Author: George R.R. Martin
Img: www.aaa.cz/got.png
Url: www.aaa.cz/got.html
Description: Game of Thrones is a ...
EAN: 9788071974925
ISBN: 978-80-7197-492-5
...
它適用於ISBN。但作者,標題和說明無法正常工作。 – tttpapi
你可以發佈你的映射和文件的例子嗎? –
我編輯了我的問題。 – tttpapi