# Significant text on nested objects

**URL:** <https://discuss.elastic.co/t/significant-text-on-nested-objects/150732>\
**Category:** Elasticsearch\
**Created:** [October 2, 2018, 4:28pm UTC](https://discuss.elastic.co/t/significant-text-on-nested-objects/150732 "2018-10-02T16:28:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![philv](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@philv](https://discuss.elastic.co/u/philv)\
**Post date:** [October 2, 2018, 4:28pm UTC](https://discuss.elastic.co/t/significant-text-on-nested-objects/150732/1 "2018-10-02T16:28:39Z")

</div>

I note here  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significanttext-aggregation.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significanttext-aggregation.html)

that significant text doesn't work on nested objects. I have nested objects on es 6.0.0 and my significant text aggregation 'works' in that I get back words that make sense, but the bg\_count figures are well in excess of my total document count. I've not deleted any documents, so I'm assuming that this bg\_count is actually the count of the nested docs and so the scores and stats are incorrect (because nested objects aren't supported).

Can someone confirm whether my hypothesis holds weight ?

best,  
Phil

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [October 2, 2018, 4:35pm UTC](https://discuss.elastic.co/t/significant-text-on-nested-objects/150732/2 "2018-10-02T16:35:21Z")

</div>

> [@philv](#):
>
> I'm assuming that this bg\_count is actually the count of the nested docs

The bg\_count lookup needs to be fast to eliminate many candidates. We use the cheapest way of doing this which is to use the pre-calculated counts held in the Lucene index for ranking purposes. These counts can include nested docs and deleted docs.  
However, you can apply a custom [background\_filter](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/search-aggregations-bucket-significanttext-aggregation.html#_custom_background_context_2) which will take longer to compute but be more accurate.

---

<div class="post-metadata">

**Author:** ![philv](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@philv](https://discuss.elastic.co/u/philv)\
**Post date:** [October 3, 2018, 8:10pm UTC](https://discuss.elastic.co/t/significant-text-on-nested-objects/150732/3 "2018-10-03T20:10:15Z")

</div>

Many thanks Mark

---

<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 31, 2018, 8:10pm UTC](https://discuss.elastic.co/t/significant-text-on-nested-objects/150732/4 "2018-10-31T20:10:17Z")

</div>

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