prefix

根据前缀去查询

  1. POST /shop/_doc/_search
  2. {
  3. "query": {
  4. "prefix": {
  5. "desc": "imo"
  6. }
  7. }
  8. }
  • head 可视化

    fuzzy

    模糊搜索,并不是指的sql的模糊搜索,而是用户在进行搜索的时候的打字错误现象,搜索引擎会自动纠正,然后尝试匹配索引库中的数据。 ```shell POST /shop/_doc/_search { “query”: { “fuzzy”: {
    1. "desc": "imoov.coom"
    } } }

    或多字段搜索

    { “query”: { “multi_match”: {
    1. "fields": [ "desc", "nickname"],
    2. "query": "imcoc supor",
    3. "fuzziness": "AUTO"
    } } }

{ “query”: { “multi_match”: { “fields”: [ “desc”, “nickname”], “query”: “演说”, “fuzziness”: “1” } } }

  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)
  2. <a name="vOST0"></a>
  3. ### wildcard
  4. 占位符查询。
  5. - ?:1个字符
  6. - *:1个或多个字符
  7. ```shell
  8. POST /shop/_doc/_search
  9. {
  10. "query": {
  11. "wildcard": {
  12. "desc": "*oo?"
  13. }
  14. }
  15. }
  16. {
  17. "query": {
  18. "wildcard": {
  19. "desc": "演*"
  20. }
  21. }
  22. }