I am trying to search Exception and results nothing.
It works if I search for the whole string com.xyz.exception.XyzException
Need help.
I am trying to search Exception and results nothing.
It works if I search for the whole string com.xyz.exception.XyzException
Need help.
What is the field mapped as in ES?
Are you using the standard analyzer/tokenizer? I don't believe it is build to split up terms by a period.
If you run this through Sense/Curl I only get one result.
Query:
GET _analyze
{
"analyzer" : "standard",
"text" : "com.xyz.exception.XyzException"
}
Results:
{
"tokens": [
{
"token": "com.xyz.exception.xyzexception",
"start_offset": 0,
"end_offset": 30,
"type": "<ALPHANUM>",
"position": 0
}
]
}
If you try the same thing for "I am a String" you get:
{
"tokens": [
{
"token": "i",
"start_offset": 0,
"end_offset": 1,
"type": "<ALPHANUM>",
"position": 0
},
{
"token": "am",
"start_offset": 2,
"end_offset": 4,
"type": "<ALPHANUM>",
"position": 1
},
{
"token": "a",
"start_offset": 5,
"end_offset": 6,
"type": "<ALPHANUM>",
"position": 2
},
{
"token": "string",
"start_offset": 7,
"end_offset": 13,
"type": "<ALPHANUM>",
"position": 3
}
]
}
© 2020. All Rights Reserved - Elasticsearch
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.