文档不会从elasticsearch的匹配查询中显示

时间:2018-06-11 09:16:41

标签: java elasticsearch kibana elastic-stack

我使用查询从elasticsearch获取文档。首先,我将使用logstash JDBC输入插件的Oracle记录带到elasticsearch。之后我将mappings添加到索引中。在我尝试使用查询获取文档的映射之后,它不会显示查询的任何结果。

请在下面找到我的映射:

PUT /documents_test4{
  "settings" : {
    "analysis" : {
      "filter" : {
        "ngram_filter" : {
          "type" : "ngram",
          "min_ngram" : 2,
          "max_ngram" : 4,
        }
      },
    "analyzer" : {
      "ngram_analyzer" : {
        "type" : "custom",
        "tokenizer" : "standard",
        "filter" : [
             "lowercase",
             "ngram_filter"
          ]
      }
    }
  }
},

"mappings" : {
  "documents_test4" : {
    "_all" : {
      "type" : "string",
      "analyzer" : "ngram_analyzer"
    },
    "properties" : {
      "filename" : {
        "type" : "string",
        "include_in_all" : true,
        "analyzer" : "ngram_analyzer"
      }
    }
  }
}

请找到以下用于从elasticsearch

获取文档的查询
GET documents_test4/_search
{
  "query" : {
    "match" : {
      "filename":"Karthikeyan"
    }
  }
}

我从elasticsearch获得以下回复

{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 0,
    "max_score": null,
    "hits": []
  }
}

另外,mapping&的语法错误低于此值query也请求。

expected one of get/post/put/delete/head syntax error 

0 个答案:

没有答案