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
A document having float type of fields may lose precision when using go client.
Steps to reproduce
Have a schema with float type of fields and persist 9223372036854775807 as the value for the field.
Retrieve (search) the document using multi-search api in Typesense go client and value will be returned as 9223372036854776000
This is not reproducible using HTTP API, the value is returned as is
Expected Behavior
Value to be returned as is
Actual Behavior
Data loss observed when using multi search api
Findings
This probably has to do with json unmarshalling the data into map[string]interface{} which by default converts all numbers to float64
There is precision loss with default conversion
This would probably need custom unmarshalling using json.Number
If there is possibility, the Document in SearchResult should be changed map[string]json.RawMessage (or be an addition to existing) to let users implement custom unmarshalling.
The text was updated successfully, but these errors were encountered:
Description
A document having
float
type of fields may lose precision when using go client.Steps to reproduce
float
type of fields and persist9223372036854775807
as the value for the field.multi-search
api in Typesense go client and value will be returned as9223372036854776000
Expected Behavior
Actual Behavior
Findings
map[string]interface{}
which by default converts all numbers tofloat64
json.Number
Document
inSearchResult
should be changedmap[string]json.RawMessage
(or be an addition to existing) to let users implement custom unmarshalling.The text was updated successfully, but these errors were encountered: