Repository navigation
fix(schema): describe list-fields flags by the names it returns - #301
Open
adityamparikh wants to merge 1 commit into
Open
adityamparikh wants to merge 1 commit into
adityamparikh wants to merge 1 commit into
Conversation
The search-collection prompt and search's "Solr rejected the request" hint told the model to look for a `D` in a field's `schema` flags, decoded by `info.key`, and to treat a field without `M` as single-valued. That is Luke's raw output. list-fields now returns `flags` as SolrJ FieldFlag names (DOC_VALUES, MULTI_VALUED, ...) and sends neither `schema` letters nor `info`, so a model following the prompt found no `D` on any field. Both now name DOC_VALUES and MULTI_VALUED, and the hint no longer says faceting needs a single-valued field. The search-collection and view-schema prompts also say that a missing or 0 `docs` on a numeric, date or docValues-only field means Solr could not count it, not that the field is empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.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
The
search-collectionprompt andsearch's "Solr rejected the request" hint describelist-fieldsoutput in Luke's raw form.list-fields(#288) now returnsflagsas SolrJFieldFlagnames and sends neitherschemaletters norinfo, so a model following the prompt found noDon any field and could conclude that nothing can be faceted or sorted.1. Learn the fields. - Call `list-fields` on `%s`. ... - (`string`/`strings`), and which are numeric/date ranges. A `D` in a field's - `schema` flags (decoded by `info.key`) means docValues: those are the fields you - can facet on, and sort on when they are single-valued (no `M`). `dynamicBase` - shows which pattern a field came from (e.g. `*_s`). + (`string`/`strings`), and which are numeric/date ranges. Fields whose `flags` + include `DOC_VALUES` are the ones you can facet on; you can sort on them when + `flags` does not also include `MULTI_VALUED`. `dynamicBase` shows which pattern a + field came from (e.g. `*_s`). A missing or 0 `docs` on a numeric, date or + docValues-only field means Solr could not count it, not that it is empty.The hint now matches the
list-fieldstool description: facet onDOC_VALUESfields, and sort only on ones that are not alsoMULTI_VALUED. It used to say faceting also needs a single-valued field, which is wrong. Theview-schemaprompt's pointer tolist-fieldsadds the samedocscaveat.Evidence
Before:
list-fieldson a collection returns, forseasons(stored in all 61 documents):There is no
schemakey, noinfo.keyand noD/M, which is what the prompt told the model to look for.docs: 0reads as "empty".After:
SearchServiceTest.searchGuidance_namesTheFlagsListFieldsReturnschecks that both the prompt and the hint nameFieldFlag.DOC_VALUESandFieldFlag.MULTI_VALUED, the namesFieldFlags.NameSerializerwrites, and mention neitherinfo.keynor "schema flags".SchemaServiceTest.viewSchemaPrompt_saysUncountedFieldsAreNotEmptycovers thedocscaveat../gradlew buildpasses (480 tests).Merge Danger
Door: two-way
Prompt and error-hint text only.
Blast Radius: prompt
🤖 Generated with Claude Code