Default highlightable? to false for returnable: false fields - #1131
Merged
Conversation
jwils
requested review from
BrianSigafoos-SQ,
ayousufi,
bsorbo,
jwondrusch and
myronmarston
as code owners
April 15, 2026 12:44
jwils
force-pushed
the
highlight-returnable-false-defaulting
branch
from
April 16, 2026 16:36
d874301 to
f8854db
Compare
myronmarston
approved these changes
Apr 21, 2026
jwils
force-pushed
the
highlight-returnable-false-defaulting
branch
from
April 22, 2026 16:49
f8854db to
b27f90b
Compare
jwils
enabled auto-merge (squash)
April 22, 2026 16:50
When a field has `returnable: false` and no explicit `highlightable:` setting, `highlightable?` now returns false. This provides storage savings by default, since the primary reason for `returnable: false` is to exclude field data from `_source`. Users can still opt in to highlighting with `returnable: false, highlightable: true`. Also updates `source_excludes_paths` to check `highlightable?` when deciding what to exclude from `_source`, so that explicitly highlightable fields remain available for search highlight snippets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jwils
force-pushed
the
highlight-returnable-false-defaulting
branch
from
April 22, 2026 16:50
b27f90b to
b4f1e3d
Compare
2 tasks
jwils
added a commit
that referenced
this pull request
Apr 23, 2026
Distills the patterns Myron Marston applies when reviewing merged PRs (naming at the caller's level of abstraction, respond_to? as a code smell, wrapper-class DI pattern, load-bearing tests, RBS/YARD hygiene, etc.) into an edit-first skill. Invoked as /myron-polish, the skill walks the current branch's diff against main and applies fixes directly rather than producing review comments. It loops — re-scan, apply edits, run script/lint --fix / script/spellcheck -w / script/type_check / script/run_gem_specs — until a full iteration makes zero edits and every verification command passes. Capped at 8 iterations. Source material: Myron's review bodies and inline comments on merged PRs #974, #973, #1067, #1066, #1108, #1120, #1131, #1134, #1144, #1107. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
highlightable?now returnsfalseforreturnable: falsefields when no explicithighlightable:is set, providing storage savings by default since non-returnable fields don't need to remain in_sourcefor highlightingsource_excludes_pathsnow checkshighlightable?when deciding what to exclude from_source, so explicitlyhighlightable: truefields stay available for search highlight snippets even whenreturnable: falsehighlightable: trueto the test schema'sinternal_nameandinternal_detailswidget fields to demonstrate the explicit opt-in patternWhy only
highlightable?highlightable?is the only-able?predicate wherereturnable: falsecreates a meaningful conflict. The other predicates all operate on indexed data (inverted index / doc values), which is always present regardless of_sourcesettings:sortable?— Sorting uses doc values, not_sourcefilterable?— Filtering runs against the inverted indexgroupable?— Grouping uses terms aggregations on indexed dataaggregatable?— Aggregations (min, max, avg, cardinality, etc.) use indexed datasub_aggregatable?— Nested sub-aggregations also work on indexed dataHighlighting is unique because the datastore must read the original text from
_sourceto produce contextual snippets (<em>matched text</em>). Whenreturnable: falseexcludes a field from_source, highlighting becomes impossible — making it the only predicate wherereturnable: falseshould influence the default.Test plan
elasticgraph-schema_definitionunit tests pass locallyelasticgraph-graphqlunit tests pass locally (1 pre-existing unrelated timezone failure)🤖 Generated with Claude Code