下面是我的代码,我必须按顺序显示结果 搜索标题与完全匹配+匹配结果与模糊1 +匹配结果与模糊2 +剩余结果部分匹配。
{
"size": 40,
"query": {
"bool": {
"must": [
{
"match": {
"in_search": 1
}
},
{
"match": {
"prod_id_active": 1
}
},
{
"match": {
"search_title": {
"query": "samsung galaaxy j7",
"fuzziness": 2,
"prefix_length": 1
}
}
},
{
"match": {
"search_title": {
"query": "samsung galaaxy j7",
"fuzziness": 2,
"prefix_length": 1
}
}
}
]
}
},
"sort": {
"category_rank": {
"order": "asc"
},
"product_rank": {
"order": "asc"
}
}
}
}