Repository navigation
Declare the content id indexes on the model - #80
Merged
Merged
Conversation
The range indexes on ContentElement(id) and Chunk(id) that #78 added were listed by hand in GraphObjectManagerStore.provision(). They now sit beside the @nodeid they serve, as @nodeid @RangeIndex on ContentElementFragment and ChunkPlaceFragment, and provision() reads them off those fragments with SchemaCatalog.fromFragments. The indexes provisioned are the same. ContentIdIndexesFollowTheModelTest checks that the derived list equals the old hand list, and scans every @NodeFragment in the model package: any fragment labelled ContentElement or Chunk whose @nodeid no declared index serves fails the test, so a new fragment can't leave its saves unindexed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #78.
What changed
#78 added range indexes on
ContentElement(id)andChunk(id), listed by hand inGraphObjectManagerStore.provision(). They now sit beside the@NodeIdthey serve:ContentElementFragmentandChunkPlaceFragmentdeclare@NodeId @RangeIndex val id.provision()reads the range indexes off those two fragments (CONTENT_ID_FRAGMENTS) withSchemaCatalog.fromFragments(...), instead of a hand-written list. The indexes provisioned are the same as before.GraphProvisioneris unchanged: convention names for vector and full-text indexes, and no renaming of an existing range index.The chunk label comes from the fragment annotation (
Chunk). That equalsproperties.chunkNodeName, because the store'sinitalready refuses any other chunk label.Why
Every save finds its node by the fragment's
@NodeId, so the index belongs on the model, next to it. With the model as the one source of the index, a new content fragment can't leave its saves unindexed without a test failing.Tests
New
ContentIdIndexesFollowTheModelTest(no database):@NodeFragmentin the model package that is labelledContentElementorChunkhas its@NodeIdserved by a declared index;@NodeIdhas no@RangeIndex(the two fragments with no indexes, and a test fragment found by another property).mvn clean install: 494 tests in 78 classes, 0 failures, 0 errors, 0 skipped (counted from the surefire XML). That includes bothNeo4jContentElementIdIndexTestcases and the 3 new tests.