adityamparikh opened a new pull request, #204: URL: https://github.com/apache/solr-mcp/pull/204
> Stacked on #201 (the CSV/XML/Markdown sample data); the first three commits here are that PR's. Merge #201 first and this diff shrinks to the XML fix. ### Summary The XML creator flattened every element by its full path from the record element, so ```xml <shows><show><id>x</id><title>T</title><genres>a</genres><genres>b</genres></show></shows> ``` produced `show_id`, `show_title`, `show_genres` and no `id` at all. Solr minted a UUID per document, re-indexing duplicated instead of replaced, and XML was the one format whose documents did not match the same data in JSON, CSV or Markdown. Anyone following the tutorial with XML had to learn a second set of field names. The record element (the root for a single document, each repeated child for many) is now a wrapper: its child elements are the fields, named after themselves, nested elements still flatten below that with underscores (`author_name`), and attributes keep the `_attr` suffix: unqualified on the record (`id_attr`), qualified by the element on a child (`name_lang_attr`). ### What changed - `XmlDocumentCreator.addRecordFields` replaces the prefixed walk for both the single- and multi-document strategies. - `XmlIndexingTest` expectations drop the record prefix (52 assertions); `ShowsSampleDataTest` now asserts XML equals JSON field for field, the same check CSV and Markdown already passed. - Tool description and javadoc describe the mapping. ### Compatibility Field names change for anyone indexing XML today (`book_title` becomes `title`). No test or doc on `main` relied on the old names beyond `XmlIndexingTest` itself, and at 0.0.2-SNAPSHOT the old mapping was a defect rather than a contract. Part of a set with #202 and #203; independent, any merge order. ### Verification - `./gradlew build` on Java 25: green. - `./gradlew nativeTest -Pnative` on GraalVM CE 25.0.2: green. - Measured against a running server: `shows.xml` indexes 61 documents in one call with `id`, `title`, `platform` and multi-valued `genres`, the same names the JSON path produces. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01CiUHyyXLTo9ATdgg8eRFZJ -- 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]
