# ElasticSearch while browsing an index that is updated every couple of minutes

**URL:** <https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659>\
**Category:** Elasticsearch\
**Created:** [February 7, 2014, 6:59am UTC](https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659 "2014-02-07T06:59:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_K](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@Tom\_K](https://discuss.elastic.co/u/Tom_K)\
**Post date:** [February 7, 2014, 6:59am UTC](https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659/1 "2014-02-07T06:59:38Z")

</div>

Hello,

To be clear and transparent - I know very little about ES. I would normally  
lurk around, but figure I might as well ask.

I have a project that I think would be a good fit for ES, but wondering to  
what extent. I'd like to use ES for what it is really good at vs trying to  
make it work in other situations.

The project is [www.lionseek.com](http://www.lionseek.com)

One part of me thinks that ES would be best if I used it only when a  
visitor conducts a text search and thereby replacing a fulltext search via  
mysql. The search query would tap into the ES index which updates every  
minute or so and the results would be displayed.

The other part of me thinks that ES can be used for much more. Basically  
every time a page is rendered, ES is involved in one way or another  
regardless if a search term/parameter is entered.

A concern I do have (with my very very limited knowledge of ES) is how  
relative timestamps would be used.

For a specific example:

1. let's say that Lionseek indexes content from a forum
2. it knows that the time of the posting is 9am today
3. the timezone of the forum is in San Francisco (UTC-08:00)
4. a time offset is entered
5. a relative time is shown to the visitor - i.e. 'updated 2 hours ago'

In MySQL we would do a sum() and join. We'd sum up the offset and the  
posted\_time column as normalized\_time.

In ES, it seems that can't be done? ES uses UTC as the timezone and that  
seems unchangeable. Maybe a new field needs to be added?

Thanks for taking the time to read through this and my ultimate question in  
the end is.... to what extent do you see ES being integrated into a project  
like Lionseek? I know it's asking a lot, but I'm hoping the gurus here can  
point to things they see and say... 'Well, I think ES would be an excellent  
component to help you in [this] regard or [that] regard.'

-Tom

--  
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/39943803-1918-4843-97ca-6c532925f47d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/39943803-1918-4843-97ca-6c532925f47d%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 7, 2014, 1:10pm UTC](https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659/2 "2014-02-07T13:10:36Z")

</div>

Tom,

You might be interested in the script\_fields functionality:

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-script-fields.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-script-fields.html)

It allows you to introduce a dynamically computed field at query-time where  
you can script the logic on how the field value is computed - for example  
like doing time offset adjustments.

--  
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/e403a680-078f-4363-b110-419243678ed2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e403a680-078f-4363-b110-419243678ed2%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tom\_K](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@Tom\_K](https://discuss.elastic.co/u/Tom_K)\
**Post date:** [February 7, 2014, 9:33pm UTC](https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659/3 "2014-02-07T21:33:56Z")

</div>

Awesome - I could definitely see using the script for calculating the  
adjustments. Thanks!

Any other ideas where ES should/should not be used on the site?

On Friday, February 7, 2014 5:10:36 AM UTC-8, Binh Ly wrote:

> Tom,
> 
> You might be interested in the script\_fields functionality:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-script-fields.html)
> 
> It allows you to introduce a dynamically computed field at query-time  
> where you can script the logic on how the field value is computed - for  
> example like doing time offset adjustments.

--  
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/6d1d74e0-6341-4892-9bf4-e05bece740c9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6d1d74e0-6341-4892-9bf4-e05bece740c9%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [February 7, 2014, 9:51pm UTC](https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659/4 "2014-02-07T21:51:49Z")

</div>

In past lives I was involved in integrating Solr to power all kinds of  
funky little "shelves" on a page. Elasticsearch can handle it. The trick  
is to make sure that you don't do too many slow thing against too many  
documents. If the shelf is built by matches and sorting (by a field or  
relevance) you are fine. Just don't run script scoring on tens of  
thousands of results on every page hit.

Nik

On Fri, Feb 7, 2014 at 4:33 PM, Tom K [tommyk@gmail.com](mailto:tommyk@gmail.com) wrote:

> Awesome - I could definitely see using the script for calculating the  
> adjustments. Thanks!
> 
> Any other ideas where ES should/should not be used on the site?
> 
> On Friday, February 7, 2014 5:10:36 AM UTC-8, Binh Ly wrote:
> 
> > Tom,
> > 
> > You might be interested in the script\_fields functionality:
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/)  
> > reference/current/search-request-script-fields.html
> > 
> > It allows you to introduce a dynamically computed field at query-time  
> > where you can script the logic on how the field value is computed - for  
> > example like doing time offset adjustments.
> 
> --  
> 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/6d1d74e0-6341-4892-9bf4-e05bece740c9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6d1d74e0-6341-4892-9bf4-e05bece740c9%40googlegroups.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAPmjWd1sh9\_QThr8Vaa33EowYT7Wa5FEp4ob%2B39pA6U6z-kA5g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1sh9_QThr8Vaa33EowYT7Wa5FEp4ob%2B39pA6U6z-kA5g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 7, 2014, 9:54pm UTC](https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659/5 "2014-02-07T21:54:33Z")

</div>

You have sorting and paging which are very straightforward to implement in  
ES. You can also do full text search using ES easily - for example, if I  
type like "club snap" into the search box, you can run a single query that  
looks for that text across multiple fields in ES easily. You can also  
further enhance the search experience using ES facets so for example, give  
hints to the user while he is searching, here are the top items by  
popularity, or by price ranges, or by brand or something along those lines.  
🙂

--  
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/23d39888-8b17-472e-9441-6627f03918d0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/23d39888-8b17-472e-9441-6627f03918d0%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tom\_K](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@Tom\_K](https://discuss.elastic.co/u/Tom_K)\
**Post date:** [February 7, 2014, 10:16pm UTC](https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659/6 "2014-02-07T22:16:30Z")

</div>

A number of categories (i.e. watches) has 100's of thousands of possible  
results that ultimately need to be sorted - price/brand/time. The default  
sorting will be by time. Are you saying that this type of sorting may be  
difficult/slow? Nothing bugs me more than a slow site - that's one of the  
main reasons I'm looking at ES.

On Friday, February 7, 2014 1:51:49 PM UTC-8, Nikolas Everett wrote:

> In past lives I was involved in integrating Solr to power all kinds of  
> funky little "shelves" on a page. Elasticsearch can handle it. The trick  
> is to make sure that you don't do too many slow thing against too many  
> documents. If the shelf is built by matches and sorting (by a field or  
> relevance) you are fine. Just don't run script scoring on tens of  
> thousands of results on every page hit.
> 
> Nik
> 
> On Fri, Feb 7, 2014 at 4:33 PM, Tom K \<[tom...@gmail.com](mailto:tom...@gmail.com) \<javascript:\>\>wrote:
> 
> > Awesome - I could definitely see using the script for calculating the  
> > adjustments. Thanks!
> > 
> > Any other ideas where ES should/should not be used on the site?
> > 
> > On Friday, February 7, 2014 5:10:36 AM UTC-8, Binh Ly wrote:
> > 
> > > Tom,
> > > 
> > > You might be interested in the script\_fields functionality:
> > > 
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/)  
> > > reference/current/search-request-script-fields.html
> > > 
> > > It allows you to introduce a dynamically computed field at query-time  
> > > where you can script the logic on how the field value is computed - for  
> > > example like doing time offset adjustments.
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/6d1d74e0-6341-4892-9bf4-e05bece740c9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6d1d74e0-6341-4892-9bf4-e05bece740c9%40googlegroups.com)  
> > .
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/34d82190-618d-4849-bb74-d804cea7c066%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/34d82190-618d-4849-bb74-d804cea7c066%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tom\_K](https://avatars.discourse-cdn.com/v4/letter/t/a5b964/32.png) [@Tom\_K](https://discuss.elastic.co/u/Tom_K)\
**Post date:** [February 7, 2014, 10:19pm UTC](https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659/7 "2014-02-07T22:19:52Z")

</div>

Good idea w/ the facets - I'll definitely be looking into that more! Thanks!

On Friday, February 7, 2014 1:54:33 PM UTC-8, Binh Ly wrote:

> You have sorting and paging which are very straightforward to implement in  
> ES. You can also do full text search using ES easily - for example, if I  
> type like "club snap" into the search box, you can run a single query that  
> looks for that text across multiple fields in ES easily. You can also  
> further enhance the search experience using ES facets so for example, give  
> hints to the user while he is searching, here are the top items by  
> popularity, or by price ranges, or by brand or something along those lines.  
> 🙂

--  
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/571e1787-6158-4478-a64f-718f170826ce%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/571e1787-6158-4478-a64f-718f170826ce%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [February 7, 2014, 10:21pm UTC](https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659/8 "2014-02-07T22:21:36Z")

</div>

Sorting is quick, but you can obviously ask Elasticsearch to do slow  
things. Just test things before you implement them on the data to be sure  
that what you are doing isn't slow.

On Fri, Feb 7, 2014 at 5:16 PM, Tom K [tommyk@gmail.com](mailto:tommyk@gmail.com) wrote:

> A number of categories (i.e. watches) has 100's of thousands of possible  
> results that ultimately need to be sorted - price/brand/time. The default  
> sorting will be by time. Are you saying that this type of sorting may be  
> difficult/slow? Nothing bugs me more than a slow site - that's one of the  
> main reasons I'm looking at ES.
> 
> On Friday, February 7, 2014 1:51:49 PM UTC-8, Nikolas Everett wrote:
> 
> > In past lives I was involved in integrating Solr to power all kinds of  
> > funky little "shelves" on a page. Elasticsearch can handle it. The trick  
> > is to make sure that you don't do too many slow thing against too many  
> > documents. If the shelf is built by matches and sorting (by a field or  
> > relevance) you are fine. Just don't run script scoring on tens of  
> > thousands of results on every page hit.
> > 
> > Nik
> > 
> > On Fri, Feb 7, 2014 at 4:33 PM, Tom K [tom...@gmail.com](mailto:tom...@gmail.com) wrote:
> > 
> > > Awesome - I could definitely see using the script for calculating the  
> > > adjustments. Thanks!
> > > 
> > > Any other ideas where ES should/should not be used on the site?
> > > 
> > > On Friday, February 7, 2014 5:10:36 AM UTC-8, Binh Ly wrote:
> > > 
> > > > Tom,
> > > > 
> > > > You might be interested in the script\_fields functionality:
> > > > 
> > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/referenc)  
> > > > e/current/search-request-script-fields.html
> > > > 
> > > > It allows you to introduce a dynamically computed field at query-time  
> > > > where you can script the logic on how the field value is computed - for  
> > > > example like doing time offset adjustments.
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/6d1d74e0-6341-4892-9bf4-e05bece740c9%  
> > > [40googlegroups.com](http://40googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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/34d82190-618d-4849-bb74-d804cea7c066%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/34d82190-618d-4849-bb74-d804cea7c066%40googlegroups.com)  
> > .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAPmjWd23oUjbdOff7XZxUtE4xPQHbGJRMHD74PcWLTS2S0B5aw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd23oUjbdOff7XZxUtE4xPQHbGJRMHD74PcWLTS2S0B5aw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:51am UTC](https://discuss.elastic.co/t/elasticsearch-while-browsing-an-index-that-is-updated-every-couple-of-minutes/15659/9 "2017-07-06T01:51:37Z")

</div>


