Assuming I have an Index & I added to it a document, by this statement:
POST /temp/item
{
"text": "[email protected] [email protected] one,two three:four"
}
I would like some query statements to return this document, for example:
*@domain**@do-*one,twothree:four--> This actually yield an error
Each selected by a statement similar to this:
GET /temp/item/_search
{
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*@domain*",
"allow_leading_wildcard": "true",
"default_operator": "AND"
}
}
]
}
}
}
None of them returned.
I understood the reason was that the Analyzer set to standard, it splitted the text by any wordboundry. So I figured that I must change the analyzer to whitespace, like this:
PUT /temp
{
"mappings": {
"item" : {
"properties" : {
"text" : {
"type" : "string",
"analyzer": "whitespace"
}
}
}
}
}
Doing so didn't solve the problem. None of the statement returned the document.
Questions
- How can I configure the Index or Change the query statement so that all of the examples above will capture.
- Why after I changed the analyzer to "whitespace" Elasticsearch didn't return the document?