This is the structure of my index "chatbot" :
{
"chatbot" : {
"aliases" : { },
"mappings" : {
"properties" : {
"answer" : {
"type" : "text"
},
"creationDate" : {
"type" : "date"
},
"isValid" : {
"type" : "boolean"
},
"owner" : {
"type" : "text"
},
"ques" : {
"type" : "text"
},
"tags" : {
"type" : "keyword"
},
"title" : {
"type" : "text"
}
}
},
"settings" : {
"index" : {
"creation_date" : "1583998852641",
"number_of_shards" : "3",
"number_of_replicas" : "1",
"uuid" : "xd5cQ4-qSjyjumhLBAPKcQ",
"version" : {
"created" : "7010199"
},
"provided_name" : "chatbot"
}
}
}
}
I have data corresponding to different types of "owner". What I want to do is to search for some data in "ques" field. Also, I specify the "owner" field for getting the result from a particular owner.
For this I'm using bool query:
GET /chatbot/_search
{
"query": {
"bool": {
"must": [
{ "match": { "ques": "alternate sources" } }
],
"filter": { "term": { "owner": "Registration" } }
}
}
}
But I'm not getting any document in the result. In my data I have one document which satisfies this condition.
Why is this happening?
How do I search for different data in different fields in Elasticsearch?