Repository navigation
SOLR-11364: fl= fix some minor issues, mostly with globs - #5188
Conversation
Callers deciding which index fields to load now ask ReturnFields directly, which works the same whether or not fl has globs. * Fields named only by an alias or transformer are no longer loaded * /select with globs: explicitly named useDocValuesAsStored=false fields and fields read by transformers are now returned/loaded * /export: a pseudo-field named like an index field no longer fetches it Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Journey:
I could file a JIRA but I feel the changes are minor. I should create a changelog. |
|
I checked on the CI failure here and it looks like it just needs a rerun, #5187 fixed it but CI ran before it merged. |
|
retriggered |
| * or for use by transformers. This is <code>false</code> for a field that only shares its name | ||
| * with a pseudo field (e.g. an alias or a transformer), unless <code>*</code> was requested. | ||
| */ | ||
| public abstract boolean wantsLuceneField(String field); |
There was a problem hiding this comment.
Just reading wantsLuceneField it is hard to see how that encodes: "index field to return or for use by transformer". wantsField OTOH is just about what gets returned. So the difference between these two is just the word Lucene which misses the important part which is these fields need to be read/loaded for further use even if they aren't returned. Perhaps usesLuceneField? My preference actually would be to drop Lucene altogether, i.e.uses(Index|Real|Source)Field but I can see Lucene is already used in SolrReturnFields so this is good for consistency.
There was a problem hiding this comment.
I proposes use of the word "loads". So loadsLuceneField or perhaps just loadsField as I'd be happy to drop the word "Lucene" as well.
wantsField ought to be renamed to returnsField with an important note in the javadocs that the name returned might be a synthetic label sourced by anything (same field, another field, a transformer output computed from anything). We can do this leaving the current name deprecated.
There was a problem hiding this comment.
loadsField is fine, I suppose it is implied if it is getting "loaded" that it is from somewhere, i.e. the index. I agree that returnsField is much better.
|
Quick Review: |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
I went further with the renames, retaining the original public methods as deprecated. |
Code that decides which index fields to load (
SolrDocumentFetcher,DocsStreamer,ExportWriter) had to piece the answer together fromgetLuceneFieldNames(),wantsField()andhasPatternMatching(). That went wrong in a few cases, mostly whenflmixes globs with explicitly named fields, aliases or transformers.ReturnFieldsnow answers those questions directly:wantsLuceneField(field): whether an index field's value is needed, either to return it or for a transformer. False for a name that belongs only to an alias or transformer, unless*was requested.isExplicitLuceneField(field): whether the field was named explicitly rather than only matched by a glob or*.SolrReturnFieldsnow keeps its explicitly named fields when globs are present.getLuceneFieldNames()still returns null in that case, as before.Effects:
useDocValuesAsStored=falsefield next to a glob (e.g.fl=val_*,_version_) was silently dropped and is now returned. The ref guide says such fields "can still be explicitly requested by name in the fl param, but will not match glob patterns" (see SOLR-10437).[json f=…],[geo f=…]) wasn't loaded whenflalso had a glob, and now is.body_t:[hl]) no longer makes/exportfetch that field, which failed when the field lacked docValues.*, instead of being silently skipped.🤖 Generated with Claude Code