# Scriped field with many conditions not loading for longer time range

**URL:** <https://discuss.elastic.co/t/scriped-field-with-many-conditions-not-loading-for-longer-time-range/142094>\
**Category:** Kibana\
**Created:** [July 30, 2018, 5:44am UTC](https://discuss.elastic.co/t/scriped-field-with-many-conditions-not-loading-for-longer-time-range/142094 "2018-07-30T05:44:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarvendra.singh](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@sarvendra.singh](https://discuss.elastic.co/u/sarvendra.singh)\
**Post date:** [July 30, 2018, 5:44am UTC](https://discuss.elastic.co/t/scriped-field-with-many-conditions-not-loading-for-longer-time-range/142094/1 "2018-07-30T05:44:36Z")

</div>

Hi Team,

We had created a scripted field as below .But when we are trying to visualize this field by selecting 2 years time range its getting time out again(values not loading) and again while its  
working fine when selecting shorter time span for example 2 months.

Please suggest what to do to visualize for long time range.Thanks in advance

doc['X'].value =="a" || doc['X'].value =="b" || doc['X'].value =="c" || doc['X'].value =="d" || doc['X'].value =="e" || doc['X'].value =="f" || doc['X'].value =="g" || doc['X'].value =="h" || doc['X'].value =="i" || doc['X'].value =="j" || doc['X'].value =="k" || doc['X'].value =="l" || doc['X'].value =="m" || doc['X'].value =="n" || doc['X'].value =="o"|| doc['X'].value =="p" || doc['X'].value =="q" || doc['X'].value =="r"|| doc['X'].value =="s" || doc['X'].value =="t" || doc['X'].value =="u" || doc['X'].value =="aa" || doc['X'].value =="ab" || doc['X'].value =="ac" || doc['X'].value =="ad" || doc['X'].value =="ae" || doc['X'].value =="af" || doc['X'].value =="w" || doc['X'].value =="x" || doc['X'].value =="y" || doc['X'].value =="z" || doc['X'].value =="A || doc['X'].value =="B" || doc['X'].value =="C" || doc['X'].value =="D" || doc['X'].value =="E" || doc['X'].value =="F" || doc['X'].value =="G" || doc['X'].value =="H" || doc['X'].value =="I" || doc['X'].value =="J" || doc['X'].value =="K" || doc['X'].value =="L" || doc['X'].value =="M" || doc['X'].value =="N" || doc['X'].value =="O" || doc['X'].value =="P" || doc['X'].value =="Q" || doc['X'].value =="R" || doc['X'].value =="S" || doc['X'].value =="T" || doc['X'].value =="U" ? "Free" : "Paid"

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 30, 2018, 5:48am UTC](https://discuss.elastic.co/t/scriped-field-with-many-conditions-not-loading-for-longer-time-range/142094/2 "2018-07-30T05:48:17Z")

</div>

Running scripts for every document at query time can get slow, so if it is a static translation like this it may be better to add this as a separate filed at indexing time and/or through reindexing of the data.

---

<div class="post-metadata">

**Author:** ![sarvendra.singh](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@sarvendra.singh](https://discuss.elastic.co/u/sarvendra.singh)\
**Post date:** [July 30, 2018, 6:41am UTC](https://discuss.elastic.co/t/scriped-field-with-many-conditions-not-loading-for-longer-time-range/142094/3 "2018-07-30T06:41:35Z")

</div>

Ok..Thanks for the reply..

Is there any other option apart from this like will increasing Timeout period work?

Thanks  
Sarvendra

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 30, 2018, 6:57am UTC](https://discuss.elastic.co/t/scriped-field-with-many-conditions-not-loading-for-longer-time-range/142094/4 "2018-07-30T06:57:45Z")

</div>

Increasing the timeout period might prevent it from timing out, but will not make it any quicker.

---

<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:** [August 27, 2018, 7:00am UTC](https://discuss.elastic.co/t/scriped-field-with-many-conditions-not-loading-for-longer-time-range/142094/5 "2018-08-27T07:00:34Z")

</div>

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