# Sequence numbers unique?

**URL:** <https://discuss.elastic.co/t/sequence-numbers-unique/97814>\
**Category:** Elasticsearch\
**Created:** [August 21, 2017, 6:41pm UTC](https://discuss.elastic.co/t/sequence-numbers-unique/97814 "2017-08-21T18:41:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ljcollins25](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ljcollins25/32/21347_2.png) [@ljcollins25](https://discuss.elastic.co/u/ljcollins25)\
**Post date:** [August 21, 2017, 6:41pm UTC](https://discuss.elastic.co/t/sequence-numbers-unique/97814/1 "2017-08-21T18:41:01Z")

</div>

Are sequence numbers unique within a shard or is the pair (primary term, sequence number) the only thing guaranteed to be unique?

---

<div class="post-metadata">

**Author:** ![ljcollins25](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ljcollins25/32/21347_2.png) [@ljcollins25](https://discuss.elastic.co/u/ljcollins25)\
**Post date:** [August 21, 2017, 7:06pm UTC](https://discuss.elastic.co/t/sequence-numbers-unique/97814/2 "2017-08-21T19:06:09Z")

</div>

Moving this question to a larger discussion on why this is important for me.

> [@Stored filters using sequence numbers](https://discuss.elastic.co/t/stored-filters-using-sequence-numbers/97816):
>
> I am working on a set of changes to ElasticSearch which allow storing a filter for documents matching a query using sequence numbers. I would like to get feedback on my approach. This is implemented with these changes: Add special query field type and \_stored\_filter meta field whose content is a query. When a document with \_stored\_filter\_query is encountered another field is added which stores the sorted sequence numbers for the documents matching the query. Introduce stored\_filter\_query whic…

---

<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:** [September 18, 2017, 7:06pm UTC](https://discuss.elastic.co/t/sequence-numbers-unique/97814/3 "2017-09-18T19:06:14Z")

</div>

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