# Write-Read question

**URL:** https://discuss.elastic.co/t/write-read-question/20345
**Category:** Elasticsearch
**Created:** [October 20, 2014, 3:29pm UTC](https://discuss.elastic.co/t/write-read-question/20345 "2014-10-20T15:29:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jackpark](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jackpark](https://discuss.elastic.co/u/jackpark)
#### Post date: [October 20, 2014, 3:29pm UTC](https://discuss.elastic.co/t/write-read-question/20345/1 "2014-10-20T15:29:57Z")

</div>

I observe, and expect a slight delay between writing an object to ES and  
being able to fetch it back. In ordinary circumstances, this is not an  
issue.

But, in the context of many agents processing information resources,  
creating indexes for them, but also needing to refer to those indexes right  
away, what are the solutions available which allow to keep each index  
object (say, a JSONObject of the indexed document) in synch across many  
agents?

Many thanks in advance.  
Jack

--  
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/CAH6s0fxyFxBRVQUv2Xxn%2BGqsLL3y8Y7QkpntbgGVTLmn2dG7ew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxyFxBRVQUv2Xxn%2BGqsLL3y8Y7QkpntbgGVTLmn2dG7ew%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)
#### Post date: [October 20, 2014, 3:56pm UTC](https://discuss.elastic.co/t/write-read-question/20345/2 "2014-10-20T15:56:59Z")

</div>

Hello Jack ,

What do you mean by "fetching it back" , is it a GET or a search.  
GET is realtime and Search is near realtime.  
You can use the refresh flag while indexing to make sure search is also  
real time , but its expensive.

Thanks  
Vineeth

On Mon, Oct 20, 2014 at 8:59 PM, Jack Park [jackpark@topicquests.org](mailto:jackpark@topicquests.org) wrote:

> I observe, and expect a slight delay between writing an object to ES and  
> being able to fetch it back. In ordinary circumstances, this is not an  
> issue.
> 
> But, in the context of many agents processing information resources,  
> creating indexes for them, but also needing to refer to those indexes right  
> away, what are the solutions available which allow to keep each index  
> object (say, a JSONObject of the indexed document) in synch across many  
> agents?
> 
> Many thanks in advance.  
> Jack
> 
> --  
> 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/CAH6s0fxyFxBRVQUv2Xxn%2BGqsLL3y8Y7QkpntbgGVTLmn2dG7ew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxyFxBRVQUv2Xxn%2BGqsLL3y8Y7QkpntbgGVTLmn2dG7ew%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxyFxBRVQUv2Xxn%2BGqsLL3y8Y7QkpntbgGVTLmn2dG7ew%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxyFxBRVQUv2Xxn%2BGqsLL3y8Y7QkpntbgGVTLmn2dG7ew%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/CAGdPd5mk7kMXrJLujaiAJHMZWMfidUOQFWCd%3DzkPMLcOas0p3Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mk7kMXrJLujaiAJHMZWMfidUOQFWCd%3DzkPMLcOas0p3Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jackpark](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jackpark](https://discuss.elastic.co/u/jackpark)
#### Post date: [October 20, 2014, 4:38pm UTC](https://discuss.elastic.co/t/write-read-question/20345/3 "2014-10-20T16:38:03Z")

</div>

Hi Veneeth,

In previous experiments, where I pre-load the index with a kind of typology  
-- the index is a topic map --, I set the refresh flag, and still had  
problems.

In doing this work, there are both GET and search queries going in.

The actual use case in question relates to a collection of JSON documents  
which are first indexed, and then later updated by agents reading other  
JSON documents which reference those indexed documents. Frequently, this  
happens nearly simultaneously in this sense: the first document is indexed,  
but it nearly immediately referenced (GET by id) by another document. When  
you have many agents doing this work, the penalty is that an already  
indexed document may not be returned to another agent if the timing is too  
close.

My solution to preloading the index with a typology was simply to create  
that typology as a collection of JSON documents which do not do any  
self-referencing, and load those.

I don't have that option here. As suggested above, my experience with  
setting the refresh flag is that it did not help in all cases. I suppose I  
could try again.

What I seek is something reliable. That's because I will soon begin dealing  
with more than 200k JSON documents, actually PubMed abstracts, and hundreds  
of Carrot2 clusters which reference them.

Many thanks  
Jack

On Mon, Oct 20, 2014 at 8:56 AM, vineeth mohan [vm.vineethmohan@gmail.com](mailto:vm.vineethmohan@gmail.com)  
wrote:

> Hello Jack ,
> 
> What do you mean by "fetching it back" , is it a GET or a search.  
> GET is realtime and Search is near realtime.  
> You can use the refresh flag while indexing to make sure search is also  
> real time , but its expensive.
> 
> Thanks  
> Vineeth
> 
> On Mon, Oct 20, 2014 at 8:59 PM, Jack Park [jackpark@topicquests.org](mailto:jackpark@topicquests.org)  
> wrote:
> 
> > I observe, and expect a slight delay between writing an object to ES and  
> > being able to fetch it back. In ordinary circumstances, this is not an  
> > issue.
> > 
> > But, in the context of many agents processing information resources,  
> > creating indexes for them, but also needing to refer to those indexes right  
> > away, what are the solutions available which allow to keep each index  
> > object (say, a JSONObject of the indexed document) in synch across many  
> > agents?
> > 
> > Many thanks in advance.  
> > Jack
> > 
> > --  
> > 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/CAH6s0fxyFxBRVQUv2Xxn%2BGqsLL3y8Y7QkpntbgGVTLmn2dG7ew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxyFxBRVQUv2Xxn%2BGqsLL3y8Y7QkpntbgGVTLmn2dG7ew%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxyFxBRVQUv2Xxn%2BGqsLL3y8Y7QkpntbgGVTLmn2dG7ew%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxyFxBRVQUv2Xxn%2BGqsLL3y8Y7QkpntbgGVTLmn2dG7ew%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/CAGdPd5mk7kMXrJLujaiAJHMZWMfidUOQFWCd%3DzkPMLcOas0p3Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mk7kMXrJLujaiAJHMZWMfidUOQFWCd%3DzkPMLcOas0p3Q%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mk7kMXrJLujaiAJHMZWMfidUOQFWCd%3DzkPMLcOas0p3Q%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mk7kMXrJLujaiAJHMZWMfidUOQFWCd%3DzkPMLcOas0p3Q%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/CAH6s0fxYJXo2VRmzvdSxyxfeGzhzhD7zpg3vO%3DczfgnvooMk1w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fxYJXo2VRmzvdSxyxfeGzhzhD7zpg3vO%3DczfgnvooMk1w%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:54am UTC](https://discuss.elastic.co/t/write-read-question/20345/4 "2017-07-06T00:54:57Z")

</div>


