Skip to content

Fix file fulltext being wiped by partial Solr updates - #3734

Open
luis100 wants to merge 1 commit into
developmentfrom
fix/file-fulltext-not-stored
Open

luis100 wants to merge 1 commit into
developmentfrom
fix/file-fulltext-not-stored

Conversation

@luis100

@luis100 luis100 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

  • FileCollection's fulltext field was stored=false. Solr's atomic/partial update ({"set": ...}) reconstructs the whole document from its stored/docValues fields before re-submitting it, so any field that's neither stored nor docValues is silently dropped in that reconstruction - fulltext was being wiped on any partial update to an IndexedFile document (e.g. AIP move, which patches FILE_ANCESTORS, or AIP permission propagation), taking the fulltextsearch copyField's terms down with it, so basic/default search on the file was affected too, not just explicit fulltext: queries.
  • Fix: drop .setStored(false) so the field uses Field's documented implicit default (stored=true), letting Solr correctly preserve it across partial updates. Also makes fulltext's raw value retrievable via fl=, which previously silently returned nothing for this field.

Fixes #3733

Test plan

  • Compiles (single-field schema definition change, no other code paths touched)
  • Against a throwaway Solr instance bootstrapped from scratch: confirm the file collection reports stored=true for fulltext, and that fl=fulltext returns real content after indexing a file with known text
  • Confirm fulltext:<term> and default/basic search both still match a file after triggering a partial update on it (e.g. moving its parent AIP)

Note for anyone applying this against an already-bootstrapped Solr collection: SolrBootstrapUtils.bootstrapCollection only logs a warning for an existing field whose attributes no longer match - it never issues a replace-field - so this won't retroactively apply to a live collection without either a schema replace-field call or a from-scratch re-bootstrap, followed by a full File reindex to repopulate fulltext for already-indexed documents.

fulltext was stored=false, so Solr's atomic update reconstruction
(which rebuilds a document from its stored/docValues fields) silently
dropped it on any partial update to an IndexedFile document - e.g.
AIP move (FILE_ANCESTORS) or permission propagation. Marking it
stored lets Solr preserve it correctly.

Fixes #3733
@luis100
luis100 requested a review from hmiguim September 9, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant