core-geonetwork icon indicating copy to clipboard operation
core-geonetwork copied to clipboard

Explicitly set a tolerant ES type for resourceEdition, resourceEditionDate and standardVersion

Open sebr72 opened this issue 2 years ago • 1 comments

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 main branch, 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.md files
  • [ ] Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

sebr72 avatar Nov 22 '23 10:11 sebr72

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 08 '24 03:12 CLAassistant