I am doing a very basic search-by-field with elastic search:
My index mapping is something like:
{
"channels": {
"mappings": {
"channel": {
"properties": {
"channel": {
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "long"
},
"name": {
"type": "string"
},
.................
....................
and my query is like:
{
"query":
{
"match":
{
"description": "hubble"
}
}
}
Now, this search results 0 hits, even if 'hubble' is present in the description field of a document.
However, when I run this query on _all field, it returns the document as expected.
As seen in the mapping, the description field is being analyzed as full-text (which is the default option). So, when only this field is specified, the search should return a hit.
What am I missing?
channel.description
instead, since according to your mapping it seems thatdescription
is an inner field of thechannel
object ;-) – Val