# Inconsistency between deserialization of number values in \_msearch/\_mget and \_search/\_get - elasticsearch-java client (7.16.2)

**URL:** <https://discuss.elastic.co/t/inconsistency-between-deserialization-of-number-values-in-msearch-mget-and-search-get-elasticsearch-java-client-7-16-2/297001>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [February 11, 2022, 4:23pm UTC](https://discuss.elastic.co/t/inconsistency-between-deserialization-of-number-values-in-msearch-mget-and-search-get-elasticsearch-java-client-7-16-2/297001 "2022-02-11T16:23:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xupi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xupi/32/101730_2.png) [@Xupi](https://discuss.elastic.co/u/Xupi)\
**Post date:** [February 11, 2022, 4:23pm UTC](https://discuss.elastic.co/t/inconsistency-between-deserialization-of-number-values-in-msearch-mget-and-search-get-elasticsearch-java-client-7-16-2/297001/1 "2022-02-11T16:23:04Z")

</div>

Hi, I have a problem with scientific notation numbers returned from elastic through \_search/\_get and \_msearch/\_mget.

Value in elastic \_source is = 1.4778125E7.

Queried through dev console is always returned the same = 1.4778125E7. For \_search/\_get and \_msearch/\_mget.

But through client \_msearch/\_mget calls, results return the value as **Integer** 14778125.

I can't provide exact code, but the problem with deserialized code happens with deserializing to this class:

```java
public class Trade { 
@JsonProperty("Definition") 
@NotNull 
private TradeDefinition definition = new TradeDefinition(); //Where this value is stored 
} 

public class TradeDefinition extends HashMap<String, Object> {}

```

Call to api is done with basic pointing to id and providing Trade.class as tDocumentClass.

After some debugging, I can say that there are used different deserialization implementations:

- for \_search/\_get calls co.elastic.clients.json.ObjectDeserializer works correctly, returning the value with scientific notation and as **Double**.
- for \_msearch/\_mget I can tell that this number is deserialized by co.elastic.clients.json.UnionDeserializer and in one moment the value pops up as JsonBigDecimalNumber, losing the notation.

I'm using the default JacksonJsonpMapper from the package. I tried to disable `DeserializationFeature.ACCEPT_FLOAT_AS_INT` but nothing changed.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 11, 2022, 4:23pm UTC](https://discuss.elastic.co/t/inconsistency-between-deserialization-of-number-values-in-msearch-mget-and-search-get-elasticsearch-java-client-7-16-2/297001/2 "2022-03-11T16:23:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
