Scriped field with many conditions not loading for longer time range

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"

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.

Ok..Thanks for the reply..

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

Thanks
Sarvendra

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

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