I have a cluster which stores device logs and I use a java client to fetch data into my application. The device logs contain special characters. So as per the documents the special characters do not get analyzed and I am not able to search certain terms which contain special characters. So I created my custom analyzer so that the terms with special characters get analyzed as per my liking
here's how the string is tokenized
Demo:123 into Demo:123, Demo, 123
This is how want my data to be analyzed. The issue arises when I use the Java api client to fetch the data.
The term queries to fetch the data of Demo:123 does not work.
{
"size": 300,
"query": {
"term": {
"string_field": {
"value": "Demo:123",
"boost": 1.0
}
}
}
}
This gives me null result but the same query works in kibana dev tools and it's not the case that the query of the java api client is malformed or anything because as soon as I remove the special character " : (colon) " the same query works and returns result.
So I don't know why the query sent through java api client returns no result but the query works in kibana dev tools.
Java Version: 8
Java HLRC version: 7.17.6
ES version: 8.11.3