elasticsearch query_error ai_generated true

ElasticsearchException: script_score function produced NaN

ID: elasticsearch/script-score-error

Also available as: JSON · Markdown
82%Fix Rate
86%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
8 active

Root Cause

Script score function produced NaN or negative score.

generic

Workarounds

  1. 90% success Add null/zero checks in score script: Math.max(0, value)
  2. 88% success Use saturation or sigmoid decay functions for bounded scores

Dead Ends

Common approaches that don't work:

  1. Return 0 for all NaN cases 72% fail

    Incorrect ranking results

  2. Remove function_score 75% fail

    Loses custom relevance tuning