adityamparikh opened a new pull request, #301:
URL: https://github.com/apache/solr-mcp/pull/301

   ## Summary
   
   The `search-collection` prompt and `search`'s "Solr rejected the request" 
hint describe `list-fields` output in Luke's raw form. `list-fields` (#288) now 
returns `flags` as SolrJ `FieldFlag` names and sends neither `schema` letters 
nor `info`, so a model following the prompt found no `D` on any field and could 
conclude that nothing can be faceted or sorted.
   
   ```diff
    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-fields` tool description: facet on 
`DOC_VALUES` fields, and sort only on ones that are not also `MULTI_VALUED`. It 
used to say faceting also needs a single-valued field, which is wrong. The 
`view-schema` prompt's pointer to `list-fields` adds the same `docs` caveat.
   
   ## Evidence
   
   - **Before:** `list-fields` on a collection returns, for `seasons` (stored 
in all 61 documents):
   
     ```json
     "seasons": {"type": "pint", "flags": 
["INDEXED","STORED","DOC_VALUES","OMIT_NORMS","OMIT_TF"], "docs": 0}
     ```
   
     There is no `schema` key, no `info.key` and no `D`/`M`, which is what the 
prompt told the model to look for. `docs: 0` reads as "empty".
   
     **After:** 
`SearchServiceTest.searchGuidance_namesTheFlagsListFieldsReturns` checks that 
both the prompt and the hint name `FieldFlag.DOC_VALUES` and 
`FieldFlag.MULTI_VALUED`, the names `FieldFlags.NameSerializer` writes, and 
mention neither `info.key` nor "schema flags". 
`SchemaServiceTest.viewSchemaPrompt_saysUncountedFieldsAreNotEmpty` covers the 
`docs` caveat. `./gradlew build` passes (480 tests).
   
   ## Merge Danger
   
   **Door:** two-way
   
   Prompt and error-hint text only.
   
   **Blast Radius:** prompt
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to