prefix
根据前缀去查询
POST /shop/_doc/_search
{
"query": {
"prefix": {
"desc": "imo"
}
}
}
- head 可视化
fuzzy
模糊搜索,并不是指的sql的模糊搜索,而是用户在进行搜索的时候的打字错误现象,搜索引擎会自动纠正,然后尝试匹配索引库中的数据。 ```shell POST /shop/_doc/_search { “query”: { “fuzzy”: {
} } }"desc": "imoov.coom"
或多字段搜索
{ “query”: { “multi_match”: {
} } }"fields": [ "desc", "nickname"],
"query": "imcoc supor",
"fuzziness": "AUTO"
{ “query”: { “multi_match”: { “fields”: [ “desc”, “nickname”], “query”: “演说”, “fuzziness”: “1” } } }
- 官文:[https://www.elastic.co/guide/cn/elasticsearch/guide/current/fuzzy-match-query.html](https://www.elastic.co/guide/cn/elasticsearch/guide/current/fuzzy-match-query.html)
<a name="vOST0"></a>
### wildcard
占位符查询。
- ?:1个字符
- *:1个或多个字符
```shell
POST /shop/_doc/_search
{
"query": {
"wildcard": {
"desc": "*oo?"
}
}
}
{
"query": {
"wildcard": {
"desc": "演*"
}
}
}