I am trying to search for a text (for example mcdonald) in my index and my
biggest issue is that if the word Terry is present in the selected field
but followed by an apostrophe (or a single quote, like McDonald's) the
search yields no result. I have a feeling that it's a problem with the
standard tokenizer so I wanted to use the letter tokenizer (as far as I
understood it would work?). So I create the index with the following :
And it didn't change anything. Also I cannot find the actual analyzer used
by the index at creation. I also tried:
"analysis": {
"analyzer": {
"my_analyzer": {
"type": "snowball",
"language": "English"
}
}
}
At index creation. As I said the biggest issue is that I cannot find the
actual analyzer used by the index nor find out what's wrong with my search
query.
P.S I am using :
"bool": {
"must": ['query_string': {
"fields": ["name.en"],
"query": 'mcdonald'
}]
}
For the actual searching. The documentation is kind of vague in this
prospect and I cannot find any solution to it anywhere.
please checkout the analyze API, which shows how a field gets broken down
into terms using a certain analyzer. This should help you to pick the right
one. Also, you might want to install the inquisitor plugin for a nice GUI
on top of the Analyze API
If you do not configure anything the analyzer is the standard analyzer.
However you can see the analyzer used per field in the mapping API.
I am trying to search for a text (for example mcdonald) in my index and my
biggest issue is that if the word Terry is present in the selected field
but followed by an apostrophe (or a single quote, like McDonald's) the
search yields no result. I have a feeling that it's a problem with the
standard tokenizer so I wanted to use the letter tokenizer (as far as I
understood it would work?). So I create the index with the following :
And it didn't change anything. Also I cannot find the actual analyzer used
by the index at creation. I also tried:
"analysis": {
"analyzer": {
"my_analyzer": {
"type": "snowball",
"language": "English"
}
}
}
At index creation. As I said the biggest issue is that I cannot find the
actual analyzer used by the index nor find out what's wrong with my search
query.
P.S I am using :
"bool": {
"must": ['query_string': {
"fields": ["name.en"],
"query": 'mcdonald'
}]
}
For the actual searching. The documentation is kind of vague in this
prospect and I cannot find any solution to it anywhere.
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.