Wildcard query that searches for content with escape special character NOT Working


(Div Sriram Sriram) #1

I have my mapping as follows:

mappings: {
    person: {
        properties: {
           name: {
               type: "string"
           }
       }
   }
}

I do a PUT of "name" : "ba\tch"

The Following WILDCARD QUERY fetches NO RESULT:

{"query": 
    {"bool" : 
       {"must" : 
          { "wildcard" : 
             { "name" : "ba\\tch*" 
             }
          }
       }
   }
 }

I dont follow the STRANGE behavior. And when I have a normal string without backslash then the wildcard search works Perfectly.
Please explain to me why does it not work as expected? And the Solution?


(David Pilato) #2

Did you put ba\tch or ba\\tch?


(Div Sriram Sriram) #3

I did a 'POST' of ba\\tch -> and in ES its indexed as ba\tch..


(system) #4