-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Core/Infra/ScriptingScripting abstractions, Painless, and MustacheScripting abstractions, Painless, and Mustache>enhancementTeam:Core/InfraMeta label for core/infra teamMeta label for core/infra team
Description
Take this search script: Math.abs(doc['field'].value)
. On every document, we will call LeafDocLookup.get
which mostly fetches script doc values for the field
field in a hashtable and advances it to the current document. The hashtable lookup feels a bit unnecessary since we will always return the same ScriptDocValues
object on a per-segment basis, is there a way we could avoid it? A hashtable lookup may look lightweight, but when everything that you do in your script is reading a doc value and applying a cheap function like Math.abs
, it might not be negligible?
Metadata
Metadata
Labels
:Core/Infra/ScriptingScripting abstractions, Painless, and MustacheScripting abstractions, Painless, and Mustache>enhancementTeam:Core/InfraMeta label for core/infra teamMeta label for core/infra team