core-geonetwork
core-geonetwork copied to clipboard
Explicitly set a tolerant ES type for resourceEdition, resourceEditionDate and standardVersion
This PR is a rework from PR: https://github.com/geonetwork/core-geonetwork/pull/6842 It allows us to avoid setting the logic in each schema index.xsl files.
When ES indexes a md, it sets the type for each field based on the value of that field that was not yet indexed. This dynamic mapping only occurs for the fields whose type has not been defined explicitly. This PR intends to:
- avoid resourceEdition to be inferred as a date
- avoid malformed resourceEditionDate to prevent the indexation of the entire md
- avoid standardVersion to be inferred as a decimal
To test this PR:
- insert md1 with a resourceEdition as a date followed by md2 with a resourceEdition as text
- insert md1 with a resourceEditionDate as a date followed by md2 with a resourceEditionDate as text
- insert md1 with a standardVersion as a decimal followed by md2 with a standardVersion as text
- Check md2 is indexed, index might need to be cleared bedore md1 insertion.
Checklist
- [x] I have read the [contribution guidelines](https://github.com/geonetwork/core-geonetwork/blob/main/CONTRIBUTING.md
- [x] Pull request provided for
mainbranch, backports managed with label - [ ] Good housekeeping of code, cleaning up comments, tests, and documentation
- [ ] Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
- [ ] Clean commit messages, longer verbose messages are encouraged
- [ ] API Changes are identified in commit messages
- [ ] Testing provided for features or enhancements using automatic tests)
- [ ] User documentation provided for new features or enhancements in mannual
- [ ] Build documentation provided for development instructions in
README.mdfiles - [ ] Library management using
pom.xmldependency management. Update build documentation with intended library use and library tutorials or documentation