Term query with special character


(Moumita Mandal) #1

Hello,

I am using Elasticsearch version "5.3.2".

I am trying to write a query that will match exact text/string.

The query looks like this:
{
query: {
bool: {
must: {
match: {
userEmail: "abc@xyz.com"
}
},
filter: {
term: { questionText: searchText }
}
}
},
size: limit,
from: skip,
}

searchText could be

  1. 5
  2. 5*2
  3. 10/5
  4. How are you?

When I am passing 5 or 2 or 10 or how as the searchText it is working fine and I am getting desired output.
But whenever I am passing 5*2 or how are as the searchText I am not getting any result.

Is this possible to use term query for exact matching of a string containing a special character or white space?


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.