我使用查询从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