I am fetching documents from elasticsearch using queries. First I am bringing Oracle records using logstash JDBC input plugin to elasticsearch. After that I am adding mappings
to the index. After the mappings I am trying to fetch documents using queries, it's not display any results from the queries.
Please find my mappings below :
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"
}
}
}
}
Please find the below query that am using to fetch documents from elasticsearch
GET documents_test4/_search
{
"query" : {
"match" : {
"filename":"Karthikeyan"
}
}
}
Am getting the below response from elasticsearch
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
Also,I am getting below syntax error for both mapping
& query
request also.
expected one of get/post/put/delete/head syntax error