# Get previous docs and following docs at innerHits

**URL:** <https://discuss.elastic.co/t/get-previous-docs-and-following-docs-at-innerhits/271156>\
**Category:** Elasticsearch\
**Created:** [April 24, 2021, 4:29pm UTC](https://discuss.elastic.co/t/get-previous-docs-and-following-docs-at-innerhits/271156 "2021-04-24T16:29:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_s/32/85970_2.png) [@Benjamin\_S](https://discuss.elastic.co/u/Benjamin_S)\
**Post date:** [April 24, 2021, 4:29pm UTC](https://discuss.elastic.co/t/get-previous-docs-and-following-docs-at-innerhits/271156/1 "2021-04-24T16:29:44Z")

</div>

Hello,  
I have an index for comments. Comments can also get sub-comments. If I search my InnerHits query for the most popular one (most likes etc). Can I somehow get the information at which position this comment is. So I would need that to show that there are e.g. 5 comments before and e.g. 10 comments after. That means I would need the information that the comment is at position 6. Is it possible to get this information?

---

<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:** [May 22, 2021, 4:29pm UTC](https://discuss.elastic.co/t/get-previous-docs-and-following-docs-at-innerhits/271156/2 "2021-05-22T16:29:54Z")

</div>

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