这样一个需求,搜索产品,关键字在字段 name 和 description 上,name 匹配度高于 desc。我写的是这样的
query: { bool: { should: [ { match: { name: { query: input, boost: 2 } } }, { match: { description: { query: input, boost: 1 } } } ] } }
这样搜索对不对,es 能不能同时对两个字段模糊搜索,它是不是只能搜索词,新手,求助。