Skip to content

GN4.2.14: Full Reindex does not index xlinked Directory contacts for iso19139.ca.HNAP, while per-record Save does #9212

@erick-ouellette

Description

@erick-ouellette

Describe the bug

When using iso19139.ca.HNAP metadata with Directory-based contacts referenced via XLink (local://srv/api/records/.../formatters/xml):

  • After Edit -> Validate -> Save, the record is correctly indexed and returns contact / contactForResource fields.
  • After Tools -> Reindex, those same fields disappear from search results for the same UUID.

The XML view of the record remains materialized and correct in both cases.

To Reproduce

  1. Enable XLink in GeoNetwork.
  2. Create a Directory (subtemplate) record containing a gmd:CI_ResponsibleParty.
  3. Reference that Directory entry from a metadata record using:
<gmd:contact xlink:type="simple" xlink:href="local://srv/api/records/<uuid>/formatters/xml"/>
  1. Edit -> Validate -> Save the metadata record.1. Query the record via the search API:
{ "size": 1, "_source": { "includes": [ "uuid", "contact", "contactForResource", "contactForDistribution" ] }, "query": { "bool": { "filter": [ { "term": { "uuid": { "value": "<uuid>" } } } ] } } }
  1. Observe that contact and contactForResource fields are present.
  2. Run Tools -> Reindex.
  3. Repeat the same _search request.
  4. Observe that contact, contactForResource, and other contact* fields are now missing.

Observed behavior

  • After Save: contact and contactForResource are indexed and returned.
  • After Reindex: those fields are absent for the same UUID.
  • XML view remains correct and materialized in both cases.

Expected behavior

Reindex should produce the same indexed fields as per-record Save.
contact* fields derived from xlinked Directory entries should be present after rebuild.

Additional context

  • This was reproduced using:
    • gmd:contact
    • contactForResource
    • (contactForDistribution intentionally not populated in this test)
  • Diagnostic XSL patching shows:
    • Save path indexes embedded/materialized CI_ResponsibleParty
    • Reindex path sees only the unresolved xlink wrapper (@xLink:href)
  • Attempts to resolve the xlink during indexing:
    • util:getUrlContent() fails for local:// protocol
    • util:getRecord() was not a viable workaround in this indexing context
  • This suggests that the rebuild/indexing pipeline does not resolve or materialize local xlinked Directory contacts before applying the indexing XSL, whereas the save path does.

Impact

  • Inconsistent search index depending on indexing pathway
  • Missing contact metadata in search results after rebuild
  • Affects Directory/XLink-based workflows in iso19139.ca.HNAP

Notes

  • The issue is reproducible without any custom patches.
  • Debug instrumentation was used only to confirm the differing code paths between Save and Reindex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions