geonetwork / geonetwork/geonetwork
Indexing: every ISO19139 record is typed resourceType=dataset regardless of hierarchyLevel
@PascalLike is already working on this.
Since Aug 18, 2026.
- Dominant language
- Java
- Stars
- 6
- Forks
- 8
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 4
Description
Every ISO19139 record is indexed as resourceType: dataset, whatever its hierarchyLevel declares. Services, series and interactive maps all come back as datasets, so any client filtering or faceting on resourceType sees a catalogue made entirely of datasets.
Reproduction
Index any ISO19139 record whose gmd:hierarchyLevel is something other than dataset, for example service. The indexed document has resourceType: ["dataset"] while cl_hierarchyLevel correctly holds service.
On a 30-record ISO19139 collection here:
resourceType (indexed) |
cl_hierarchyLevel (declared in the metadata) |
records |
|---|---|---|
| dataset | service | 12 |
| dataset | dataset | 10 |
| dataset | series | 3 |
| dataset | interactiveMap | 1 |
| dataset | none | 2 |
| none | none | 2 |
The resourceType facet therefore reports dataset (28) and nothing else, on a catalogue that holds 12 services, 3 series and a map.
Cause
index-resourceType in src/modules/indexing/src/main/resources/indexing/xslt/iso-utility.xsl:
<xsl:variable name="isDataset" as="xs:boolean"
select="
count(*:metadataScope[*/*:resourceScope/*/@codeListValue = 'dataset']) > 0 or
count(*:hierarchyLevel[*/@codeListValue='dataset']) > 0 or
count(*:metadataScope) = 0"/>
The third clause is the "no scope declared means dataset" fallback. metadataScope is the ISO19115-3 element name. An ISO19139 record declares its scope in hierarchyLevel and never has a metadataScope, so for every ISO19139 record that clause is true, $isDataset is true, and the xsl:choose below returns dataset before it can reach the branch that reads the declared scope.
The second clause remembers to check hierarchyLevel. The fallback does not.
GN4 gets this right. In schemas/iso19139/src/main/plugin/iso19139/index-fields/index.xsl the same fallback reads:
count(gmd:hierarchyLevel[gmd:MD_ScopeCode/@codeListValue='dataset']) > 0 or
count(gmd:hierarchyLevel) = 0
Possibly related: $isService is computed just below $isDataset and is never used in the xsl:choose.
Suggested fix
Make the fallback require both scope elements to be absent:
(count(*:metadataScope) = 0 and count(*:hierarchyLevel) = 0)
Impact
resourceType is a queryable and a facet in OGC API - Records, so a Resource Type filter built on it silently collapses to a single value on any ISO19139 catalogue. Reading cl_hierarchyLevel instead works as a client-side workaround, but that field is a codelist rather than the documented type field.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.