Skip to content

Add function_score query support#68

Merged
GokselKUCUKSAHIN merged 1 commit intomainfrom
feature/function-score-query
Feb 7, 2026
Merged

Add function_score query support#68
GokselKUCUKSAHIN merged 1 commit intomainfrom
feature/function-score-query

Conversation

@GokselKUCUKSAHIN
Copy link
Member

Implement function_score query with full DSL support including:

  • FunctionScore constructor with query wrapping
  • Top-level parameters: Boost, MaxBoost, ScoreMode, BoostMode, MinScore, Weight
  • Inline scoring: ScriptScore, RandomScore, FieldValueFactor
  • Functions array with ScriptScoreFunction, RandomScoreFunction, WeightFunction, FieldValueFactorFunction, DecayFunction (gauss, linear, exp)
  • Function-level Filter and Weight support
  • FieldValueFactor with Factor, Modifier, Missing parameters
  • Decay functions with Origin, Scale, Offset, DecayValue, MultiValueMode

New enums:

  • boost-mode: multiply, replace, sum, avg, max, min
  • modifier: none, log, log1p, log2p, ln, ln1p, ln2p, square, sqrt, reciprocal
  • multi-values-mode: min, max, avg, sum

All implementations follow existing project conventions and patterns.

Implement function_score query with full DSL support including:
- FunctionScore constructor with query wrapping
- Top-level parameters: Boost, MaxBoost, ScoreMode, BoostMode, MinScore, Weight
- Inline scoring: ScriptScore, RandomScore, FieldValueFactor
- Functions array with ScriptScoreFunction, RandomScoreFunction, WeightFunction,
  FieldValueFactorFunction, DecayFunction (gauss, linear, exp)
- Function-level Filter and Weight support
- FieldValueFactor with Factor, Modifier, Missing parameters
- Decay functions with Origin, Scale, Offset, DecayValue, MultiValueMode

New enums:
- boost-mode: multiply, replace, sum, avg, max, min
- modifier: none, log, log1p, log2p, ln, ln1p, ln2p, square, sqrt, reciprocal
- multi-values-mode: min, max, avg, sum

All implementations follow existing project conventions and patterns.
@GokselKUCUKSAHIN GokselKUCUKSAHIN linked an issue Feb 7, 2026 that may be closed by this pull request
@GokselKUCUKSAHIN GokselKUCUKSAHIN changed the title feat: add function_score query support Add function_score query support Feb 7, 2026
@GokselKUCUKSAHIN GokselKUCUKSAHIN added enhancement New feature or request go Pull requests that update go code labels Feb 7, 2026
@GokselKUCUKSAHIN GokselKUCUKSAHIN self-assigned this Feb 7, 2026
@GokselKUCUKSAHIN GokselKUCUKSAHIN merged commit ba0c8d7 into main Feb 7, 2026
14 checks passed
@GokselKUCUKSAHIN GokselKUCUKSAHIN deleted the feature/function-score-query branch February 7, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Function Score Query

1 participant