# Inconsistency in parsing timestamps for search\_after

**URL:** <https://discuss.elastic.co/t/inconsistency-in-parsing-timestamps-for-search-after/285463>\
**Category:** Elasticsearch\
**Created:** [September 29, 2021, 10:33am UTC](https://discuss.elastic.co/t/inconsistency-in-parsing-timestamps-for-search-after/285463 "2021-09-29T10:33:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![muchawiec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/muchawiec/32/95251_2.png) [@muchawiec](https://discuss.elastic.co/u/muchawiec)\
**Post date:** [September 29, 2021, 10:33am UTC](https://discuss.elastic.co/t/inconsistency-in-parsing-timestamps-for-search-after/285463/1 "2021-09-29T10:33:00Z")

</div>

Hello,  
I've been fighting with pagination using `search_after` for dates that might be undefined.  
When I sort in ascending order and the date is undefined I receive in `sort` property value 9223372036854775807, which I can pass as string to `search_after` (I have to do because of Javascript number precision issue) and receive next chunk of hits.  
But when I reverse the order, I'll get -9223372036854775808 in response, which I can only pass as number not string because of parsing issue.

Why is that I can pass negative timestamp as number but not as string? How to workaround this?  
Thanks for advance for tips.

---

<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:** [October 27, 2021, 10:33am UTC](https://discuss.elastic.co/t/inconsistency-in-parsing-timestamps-for-search-after/285463/2 "2021-10-27T10:33:01Z")

</div>

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