# ES: Ways to work with frequently updated fields of document

**URL:** <https://discuss.elastic.co/t/es-ways-to-work-with-frequently-updated-fields-of-document/22865>\
**Category:** Elasticsearch\
**Created:** [March 24, 2015, 5:28pm UTC](https://discuss.elastic.co/t/es-ways-to-work-with-frequently-updated-fields-of-document/22865 "2015-03-24T17:28:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![11181](https://avatars.discourse-cdn.com/v4/letter/1/34f0e0/32.png) [@11181](https://discuss.elastic.co/u/11181)\
**Post date:** [March 24, 2015, 5:28pm UTC](https://discuss.elastic.co/t/es-ways-to-work-with-frequently-updated-fields-of-document/22865/1 "2015-03-24T17:28:19Z")

</div>

I have forum. And every topic has such field as viewCount - how many times topic was viewed by forum users.

I wanted that all fields of topics were taken from ES (id,date,title,content and viewCount). However, this case after every topic view ES must reindex entire document again - I asked the question about particial update at stack - [http://stackoverflow.com/questions/28937946/partial-update-on-field-that-is-not-indexed](http://stackoverflow.com/questions/28937946/partial-update-on-field-that-is-not-indexed) .

It means that if topic is viewed 1000 times ES will index it 1000 times. And if I have a lot of users many documents will be indexed again and again. This is first strategy.

The second strategy, as I think is to take some fields of topic from index and some from database. At this case I take viewAcount from DB. However, then I can store all fields in DB and use index only as INDEX - to get ids of current topic.

Are there better strategies? What is the best way to solve such problem?

--  
Александр Свиридов

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru](https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 24, 2015, 9:32pm UTC](https://discuss.elastic.co/t/es-ways-to-work-with-frequently-updated-fields-of-document/22865/2 "2015-03-24T21:32:35Z")

</div>

Best best is to try to separate hot and cold/warm data so you are only  
updating things which _need_ to be updated.  
It may make sense to split this out into different systems, but this is  
really up to you.

On 25 March 2015 at 04:28, Александр Свиридов [ooo\_saturn7@mail.ru](mailto:ooo_saturn7@mail.ru) wrote:

> I have forum. And every topic has such field as viewCount - how many times  
> topic was viewed by forum users.
> 
> I wanted that all fields of topics were taken from ES  
> (id,date,title,content and viewCount). However, this case after every topic  
> view ES must reindex entire document again - I asked the question about  
> particial update at stack -  
> [java - Partial update on field that is not indexed - Stack Overflow](http://stackoverflow.com/questions/28937946/partial-update-on-field-that-is-not-indexed)  
> .
> 
> It means that if topic is viewed 1000 times ES will index it 1000 times.  
> And if I have a lot of users many documents will be indexed again and  
> again. This is first strategy.
> 
> The second strategy, as I think is to take some fields of topic from index  
> and some from database. At this case I take viewAcount from DB. However,  
> then I can store all fields in DB and use index only as INDEX - to get ids  
> of current topic.
> 
> Are there better strategies? What is the best way to solve such problem?
> 
> --  
> Александр Свиридов
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru](https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru)  
> [https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9P6L49jbDpOccA\_z-ckKVFjz1o%2BXWWttN%2BYneL0YBfDg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9P6L49jbDpOccA_z-ckKVFjz1o%2BXWWttN%2BYneL0YBfDg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![11181](https://avatars.discourse-cdn.com/v4/letter/1/34f0e0/32.png) [@11181](https://discuss.elastic.co/u/11181)\
**Post date:** [March 25, 2015, 5:38am UTC](https://discuss.elastic.co/t/es-ways-to-work-with-frequently-updated-fields-of-document/22865/3 "2015-03-25T05:38:19Z")

</div>

By different systems do you mean database, ES etc?

Среда, 25 марта 2015, 8:32 +11:00 от Mark Walkom [markwalkom@gmail.com](mailto:markwalkom@gmail.com):

> Best best is to try to separate hot and cold/warm data so you are only updating things which _need_ to be updated.  
> It may make sense to split this out into different systems, but this is really up to you.
> 
> On 25 March 2015 at 04:28, Александр Свиридов \< [ooo\_saturn7@mail.ru](mailto:ooo_saturn7@mail.ru) \> wrote:
> 
> > I have forum. And every topic has such field as viewCount - how many times topic was viewed by forum users.
> > 
> > I wanted that all fields of topics were taken from ES (id,date,title,content and viewCount). However, this case after every topic view ES must reindex entire document again - I asked the question about particial update at stack - [java - Partial update on field that is not indexed - Stack Overflow](http://stackoverflow.com/questions/28937946/partial-update-on-field-that-is-not-indexed) .
> > 
> > It means that if topic is viewed 1000 times ES will index it 1000 times. And if I have a lot of users many documents will be indexed again and again. This is first strategy.
> > 
> > The second strategy, as I think is to take some fields of topic from index and some from database. At this case I take viewAcount from DB. However, then I can store all fields in DB and use index only as INDEX - to get ids of current topic.
> > 
> > Are there better strategies? What is the best way to solve such problem?
> > 
> > ## -- Александр Свиридов
> > 
> > You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) .  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru](https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru) .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) .
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) .  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9P6L49jbDpOccA\_z-ckKVFjz1o%2BXWWttN%2BYneL0YBfDg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9P6L49jbDpOccA_z-ckKVFjz1o%2BXWWttN%2BYneL0YBfDg%40mail.gmail.com) .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) .

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1427261899.358293155%40f317.i.mail.ru](https://groups.google.com/d/msgid/elasticsearch/1427261899.358293155%40f317.i.mail.ru).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 25, 2015, 6:27am UTC](https://discuss.elastic.co/t/es-ways-to-work-with-frequently-updated-fields-of-document/22865/4 "2015-03-25T06:27:15Z")

</div>

Yes that is what I mean.

On 25 March 2015 at 16:38, Александр Свиридов [ooo\_saturn7@mail.ru](mailto:ooo_saturn7@mail.ru) wrote:

> By different systems do you mean database, ES etc?
> 
> Среда, 25 марта 2015, 8:32 +11:00 от Mark Walkom [markwalkom@gmail.com](mailto:markwalkom@gmail.com):
> 
> Best best is to try to separate hot and cold/warm data so you are only  
> updating things which _need_ to be updated.  
> It may make sense to split this out into different systems, but this is  
> really up to you.
> 
> On 25 March 2015 at 04:28, Александр Свиридов \<[ooo\_saturn7@mail.ru](mailto:ooo_saturn7@mail.ru)  
> [https://e.mail.ru/compose/?mailto=mailto%3Aooo\_saturn7@mail.ru](https://e.mail.ru/compose/?mailto=mailto%3aooo_saturn7@mail.ru)\> wrote:
> 
> I have forum. And every topic has such field as viewCount - how many times  
> topic was viewed by forum users.
> 
> I wanted that all fields of topics were taken from ES  
> (id,date,title,content and viewCount). However, this case after every topic  
> view ES must reindex entire document again - I asked the question about  
> particial update at stack -  
> [java - Partial update on field that is not indexed - Stack Overflow](http://stackoverflow.com/questions/28937946/partial-update-on-field-that-is-not-indexed)  
> .
> 
> It means that if topic is viewed 1000 times ES will index it 1000 times.  
> And if I have a lot of users many documents will be indexed again and  
> again. This is first strategy.
> 
> The second strategy, as I think is to take some fields of topic from index  
> and some from database. At this case I take viewAcount from DB. However,  
> then I can store all fields in DB and use index only as INDEX - to get ids  
> of current topic.
> 
> Are there better strategies? What is the best way to solve such problem?
> 
> --  
> Александр Свиридов
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com)  
> [https://e.mail.ru/compose/?mailto=mailto%3Aelasticsearch%2Bunsubscribe@googlegroups.com](https://e.mail.ru/compose/?mailto=mailto%3aelasticsearch%2bunsubscribe@googlegroups.com)  
> .  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru](https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru)  
> [https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/1427218099.583181766%40f355.i.mail.ru?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com)  
> [https://e.mail.ru/compose/?mailto=mailto%3Aelasticsearch%2Bunsubscribe@googlegroups.com](https://e.mail.ru/compose/?mailto=mailto%3aelasticsearch%2bunsubscribe@googlegroups.com)  
> .  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9P6L49jbDpOccA\_z-ckKVFjz1o%2BXWWttN%2BYneL0YBfDg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9P6L49jbDpOccA_z-ckKVFjz1o%2BXWWttN%2BYneL0YBfDg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9P6L49jbDpOccA\_z-ckKVFjz1o%2BXWWttN%2BYneL0YBfDg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9P6L49jbDpOccA_z-ckKVFjz1o%2BXWWttN%2BYneL0YBfDg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1427261899.358293155%40f317.i.mail.ru](https://groups.google.com/d/msgid/elasticsearch/1427261899.358293155%40f317.i.mail.ru)  
> [https://groups.google.com/d/msgid/elasticsearch/1427261899.358293155%40f317.i.mail.ru?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/1427261899.358293155%40f317.i.mail.ru?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-iBdkCN-Gy%3D0%3DSWizTPyccSWp6PTEn32ju6jrTJwmP%3Dw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-iBdkCN-Gy%3D0%3DSWizTPyccSWp6PTEn32ju6jrTJwmP%3Dw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:24am UTC](https://discuss.elastic.co/t/es-ways-to-work-with-frequently-updated-fields-of-document/22865/5 "2017-07-06T00:24:13Z")

</div>


