如何使Elasticsearch在给定的全文中起作用?

时间:2019-05-26 11:41:32

标签: spring-boot elasticsearch

我有诸如“ Document se”之类的搜索文字。如果我在弹性搜索中进行搜索,则会根据我不想要的“文档”和“ se”单词给出结果。我想要包含“ Document se”文本(不区分大小写)的结果。我在springboot项目中尝试了Elasticserach,但不知道该怎么办。

映射:

{
  "my_index": {
    "aliases": {},
    "mappings": {
      "my": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "id": {
            "type": "keyword"
          },
          "label": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "type": {
            "type": "keyword"
          }
        }
      }
    },
    "settings": {
      "index": {
        "refresh_interval": "1s",
        "number_of_shards": "5",
        "provided_name": "my_index",
        "creation_date": "1558871069777",
        "store": {
          "type": "fs"
        },
        "number_of_replicas": "1",
        "uuid": "X1b0YIgGSOu7vki2RjqjsA",
        "version": {
          "created": "6040399"
        }
      }
    }
  }
}

0 个答案:

没有答案