Need a script field tag to calculate time difference


this will give me overall time taken for a request. I can use this field to show average time over a period of time.

There are two solutions to this in addition to a script field - which I would both prefer

First, there is something called a runtime field similar to a script field, that allows you to configure a dynamic field in the mapping, that substracts the two dates via a script. The advantage of having this as a runtime field is, that you can treat this across all your queries as if this was an indexed field by just specifying a field name. And the advantage of this approach is, that...

you can go with the second approach and create this field on index time using a script processor. When you are doing that and you pick the same field name as with the runtime field in the beginning, you will not need to change your query, when you switch from a runtime field to the script processor.

Hope that helps!

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