-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Elasticsearch version: docker.elastic.co/elasticsearch/elasticsearch:6.3.2
Kibana: docker.elastic.co/kibana/kibana:6.3.2
Plugins installed: none
Description of the problem including expected versus actual behavior:
- create index for completion suggest
- Put 3 documents with a custom ID in the index
- search the index for a word contained in 2 of the documents
- get 2 mangled results (field text does not belong to source)
Steps to reproduce:
This is terribly hard to reproduce. Just anonymising the data but still trying to reproduce this bug was almost impossible. If you change one little thing, it's not reproducable. So maybe this helps in finding the cause of this. If we are doing something wrong, please tell us, we're on our wits end.
Removing the ID works in this specific case, but it does not solve the issue completely. The bug would still pop up in our system with different documents.
copy paste from kibana:
DELETE test_suggest
PUT test_suggest
{
"mappings": {
"something": {
"properties": {
"what_suggest": {
"type": "completion"
}
}
}
}
}
PUT test_suggest/something/profile_284
{
"id": "profile_284",
"term": "ab abcdefghij klmnopq",
"where_suggest": [],
"street_suggest": [],
"what_suggest": [
{
"input": "abcdefghij klmnopq",
"weight": 3
}
],
"value": "ab abcdefghij klmnopq"
}
PUT test_suggest/something/profile_285
{
"id": "profile_285",
"term": "dr zyxwvu wrong abcdef",
"where_suggest": [],
"street_suggest": [],
"what_suggest": [
{
"input": "zyxwvu wrong",
"weight": 3
}
],
"value": "dr zyxwvu wrong abcdef"
}
PUT test_suggest/something/profile_286
{
"id": "profile_286",
"term": "abcd efg hi zyxwvu abcdefgh",
"where_suggest": [],
"street_suggest": [],
"what_suggest": [
{
"input": "zyxwvu abcdefgh",
"weight": 3
}
],
"value": "abcd efg hi zyxwvu abcdefgh"
}
POST test_suggest/something/_search
{
"size": 20,
"suggest": {
"test_suggest": {
"prefix": "zyxwvu",
"completion": {
"field": "what_suggest",
"size": 10,
"fuzzy": {
"fuzziness": 0
}
}
}
}
}
result of the search:
The document in _source does not match the value in the field text
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 0,
"max_score": 0,
"hits": []
},
"suggest": {
"test_suggest": [
{
"text": "zyxwvu",
"offset": 0,
"length": 6,
"options": [
{
"text": "zyxwvu abcdefgh",
"_index": "test_suggest",
"_type": "something",
"_id": "profile_285",
"_score": 18,
"_source": {
"id": "profile_285",
"term": "dr zyxwvu wrong abcdef",
"where_suggest": [],
"street_suggest": [],
"what_suggest": [
{
"input": "zyxwvu wrong",
"weight": 3
}
],
"value": "dr zyxwvu wrong abcdef"
}
},
{
"text": "zyxwvu wrong",
"_index": "test_suggest",
"_type": "something",
"_id": "profile_286",
"_score": 18,
"_source": {
"id": "profile_286",
"term": "abcd efg hi zyxwvu abcdefgh",
"where_suggest": [],
"street_suggest": [],
"what_suggest": [
{
"input": "zyxwvu abcdefgh",
"weight": 3
}
],
"value": "abcd efg hi zyxwvu abcdefgh"
}
}
]
}
]
}
}