I am using ES 6.4 .
When I tried
GET /_search?size=10&from=0
{
"_source":["name"],
"query":{
"query_string" : {
"query" : "(some1.some.string.test.query.1234.test) AND (status:active) AND NOT (xyz OR abc)",
"fields" : ["name"]
}
}
}
It is returning expected results.
But when I tried ,
GET /_search?size=10&from=0
{
"_source":["name"],
"query":{
"query_string" : {
"query" : "(some1.some.string.test.query.1234.) AND (status:active) AND NOT (xyz OR abc)",
"fields" : ["name"]
}
}
}
It is returning null, even though matches are there.
{
"took": 38,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits":
}
}
Can any of you give me more idea on what happens in this case, when wild card is used along with longer strings?
Thanks in advance.
Thanks for the reply. I have already tried using backslash.
But single backslash is not supported
\*some1.some.string.test.query.1234.\*
"type": "json_parse_exception",
"reason": "Unrecognized character escape '*' (code 42)\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@55a18add; line: 5, column: 21]"
So I tried \\*some1.some.string.test.query.1234.\\* with double backslash, and that gave me the expected results.
But the same on a small string (sub string of the same) didn't returned any results. \\*some1.\\*
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits":
}
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.