You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When you have an array of a struct with two fields named "key" and "value," it gets automatically converted into a map<string, string> when queried via the search API. This conversion does not occur when using the document API, and it can lead to data loss in the search response if there are duplicate keys.
To Reproduce
Steps to reproduce the behavior:
Used sample application:
schema doc {
document doc {
struct label {
field key type string {
}
field value type string {
}
}
field data type array<label> {
indexing: summary
struct-field key { indexing: attribute }
struct-field value { indexing: attribute }
}
}
fieldset default {
fields: data
}
}
{
"yql": "select * from sources doc where true",
"tracelevel": 1
}
Inspect the search response, where the array<label> has been converted into a map<string, string>, resulting in the loss of the value "Some value" for the "Same Key" key.
Expected behavior
I would expect the search response to behave similarly to the document API response and return the array<label> struct, rather than converting it to a map<string, string>. If I wanted this behavior, I would have specified the data type accordingly.
Environment (please complete the following information):
Dockerized vespa
Vespa version
Vespa version: 8.475.11
Additional context
This issue does not occur if the struct fields have different names than "key" and "value".
The text was updated successfully, but these errors were encountered:
Describe the bug
When you have an array of a struct with two fields named "key" and "value," it gets automatically converted into a map<string, string> when queried via the search API. This conversion does not occur when using the document API, and it can lead to data loss in the search response if there are duplicate keys.
To Reproduce
Steps to reproduce the behavior:
array<label>
format:array<label>
has been converted into a map<string, string>, resulting in the loss of the value "Some value" for the "Same Key" key.Expected behavior
I would expect the search response to behave similarly to the document API response and return the
array<label>
struct, rather than converting it to a map<string, string>. If I wanted this behavior, I would have specified the data type accordingly.Environment (please complete the following information):
Dockerized vespa
Vespa version
Vespa version: 8.475.11
Additional context
This issue does not occur if the struct fields have different names than "key" and "value".
The text was updated successfully, but these errors were encountered: