【发布时间】:2013-02-19 14:05:10
【问题描述】:
我的文档索引如下:
{
title: "stuff here",
description: "stuff here",
keywords: "stuff here",
score1: "number here",
score2: "number here"
}
我想执行以下查询:
- 使用标题、描述和关键字字段来匹配文本术语。
- 不必完全匹配。例如。如果有人搜索“我有一个大鼻子”,并且其中一个文档标题中有“鼻子”但没有“大”,则仍应返回此文档。
编辑:我尝试了这个查询并且它有效。有人可以确认这是否是正确的方法吗?谢谢。
{
query:{
'multi_match':{
'query': q,
'fields': ['title^2','description', 'keywords'],
}
}
}
【问题讨论】:
标签: elasticsearch