Details
-
Bug
-
Resolution: Fixed
-
Major
-
7.0.1, Cheshire-Cat
-
Untriaged
-
1
-
Unknown
Description
Here's a sample search response for a query over an index alias ..
AD: ~/Documents/couchbaseCC/ns_server $ curl -XPOST -H "Content-type:application/json" http://Administrator:asdasd@127.0.0.1:9200/api/index/airlines/query -d '{"query": {"query": "edit"}}' | jq |
% Total % Received % Xferd Average Speed Time Time Time Current
|
Dload Upload Total Spent Left Speed
|
100 852 100 824 100 28 4603 156 --:--:-- --:--:-- --:--:-- 4759 |
{
|
"status": { |
"total": 2, |
"failed": 0, |
"successful": 2 |
},
|
"request": { |
"query": { |
"query": "edit" |
},
|
"size": 10, |
"from": 0, |
"highlight": null, |
"fields": null, |
"facets": null, |
"explain": false, |
"sort": [ |
"-_score" |
],
|
"includeLocations": false, |
"search_after": null, |
"search_before": null |
},
|
"hits": [ |
{
|
"index": "temp_144737e315264058_4c1c5584", |
"id": "\b\u0000\u0000\u0000one", |
"score": 0.2972674459459178, |
"sort": [ |
"_score" |
]
|
},
|
{
|
"index": "default_2d9ca20632cb632e_4c1c5584", |
"id": "\t\u0000\u0000\u0000two", |
"score": 0.2972674459459178, |
"sort": [ |
"_score" |
]
|
},
|
{
|
"index": "temp_144737e315264058_4c1c5584", |
"id": "\t\u0000\u0000\u0000two", |
"score": 0.2972674459459178, |
"sort": [ |
"_score" |
]
|
},
|
{
|
"index": "default_2d9ca20632cb632e_4c1c5584", |
"id": "\b\u0000\u0000\u0000one", |
"score": 0.2972674459459178, |
"sort": [ |
"_score" |
]
|
}
|
],
|
"total_hits": 4, |
"max_score": 0.2972674459459178, |
"took": 276179, |
"facets": null |
}
|
So the hit IDs in the search response would look like this ..
\t\u0000\u0000\u0000two
|
And because of this, the docID links on the UI wouldn't work either.
The fix is to decorate document hits for search responses from an index alias ..
- Strip collection bytes from the ID
- Add _$c to the hit.Fields, which is used to look up the source document by the document viewer.