New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex in Completion Suggestion not working for Unicode (simple analyzer). #33305
Comments
Pinging @elastic/es-search-aggs |
Correcting the json requests as they were broken with markdown:
|
There is a missing conversion in the |
My corpus is not large. Currently we are happy with the speed. What I try to accomplish is to match options like: The query parsed in to a regex. For example |
Ok thanks @bbfsdev . We've discussed the problems with |
Any update or any alternative solutions on this issue? |
Elastic
Version: 6.3.0, Build: default/tar/424e937/2018-06-11T23:38:03.357887Z, JVM: 1.8.0_161
No plugins
Java
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
OS
Linux kk-dev 3.19.0-80-generic #88~14.04.1-Ubuntu SMP Fri Jan 13 14:54:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Description:
Regex in Completion Suggestion not working for Unicode (simple analyzer).
Eventually I would like to use other then simple analyzers.
Steps to reproduce:
PUT /example
{
"mappings": {
"_doc": {
"properties": {
"suggest_field": {
"type": "completion"
}
}
}
}
}
PUT example/_doc/0?refresh
{
"suggest_field" : {
"input": ["אחת שניים שלוש", "שניים שלוש ארבע"]
}
}
PUT example/_doc/1?refresh
{
"suggest_field" : {
"input": ["one two three", "two three four"]
}
}
// This one works well
GET example/_doc/_search
{
"suggest": {
"suggest_field": {
"regex": ".r.",
"completion": {
"field": "suggest_field"
}
}
}
}
// Result:
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 0,
"max_score": 0,
"hits": []
},
"suggest": {
"suggest_field": [
{
"text": ".r.",
"offset": 0,
"length": 5,
"options": [
{
"text": "one two three",
"_index": "example",
"_type": "_doc",
"_id": "1",
"_score": 1,
"_source": {
"suggest_field": {
"input": [
"one two three",
"two three four"
]
}
}
}
]
}
]
}
}
// This one fails, i.e., returns empty options
GET example/_doc/_search
{
"suggest": {
"suggest_field": {
"regex": ".א.",
"completion": {
"field": "suggest_field"
}
}
}
}
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 0,
"max_score": 0,
"hits": []
},
"suggest": {
"suggest_field": [
{
"text": ".א.",
"offset": 0,
"length": 5,
"options": []
}
]
}
}
Thanks!
The text was updated successfully, but these errors were encountered: