Repository navigation
refactor(plugins): share the document path resolver and refresh a stale Elasticsearch mapping - #2922
Merged
Merged
Conversation
…le Elasticsearch mapping
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This branch was successfully deployed
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 #2905, which merged before these two review findings were addressed.
One document path resolver, not two
ElasticsearchMappingFlattenerandTypesenseSchemaeach carried a character-for-character copy of the same dotted-path walker. Both now callDocumentPath.value(in:atPath:)in the new dependency-freeTableProDocumentPathtarget, which both plugins andTableProTestslink.The shared version keeps the positional rule #2905 added on the Elasticsearch side: an element that lacks the key holds its place as
null. Typesense dropped it, sovariants.skucame back one entry shorter thanvariants.qtyand the second sku read as the first variant's. That is a user-visible Typesense fix, so it has its own CHANGELOG line.A stale mapping is refreshed
_mappingCachewas filled once per index and only ever cleared on disconnect, so aPUT /index/_mappingtyped in the console left the grid showing the old columns for the rest of the session, and a filter on a new field matched nothing. Any console request whose method is notGETorHEADnow drops the cache.ElasticsearchOperations.changesMapping(method:)holds that rule so it can be tested; the sidebar's Drop Index goes through it too, since it runs asDELETE /<index>.Row writes do not invalidate: the generator only ever writes columns that came from the mapping, so dynamic mapping cannot add a field behind them.
An alias reports every index it covers
properties(fromMappingResponse:index:)fell back toresponse.values.firstwhen the response was not keyed by the name asked for, which is every alias and every wildcard: one index's columns stood in for all of them. It now unions the fields of every index in the response, first declaration winning so the result does not depend on dictionary order.Verification
verify.sh build,build ElasticsearchDriverPlugin,build TypesenseDriverPlugin: passverify.sh testover the Elasticsearch, Typesense and classifier suites: 263 passed, 0 failedswift test --filter DocumentPathTestsinPackages/TableProCore: 9 passedverify.sh docs: pass