Repository navigation
feat: index posts, releases and changelog in search - #31
Open
mattdjenkinson wants to merge 1 commit into
Open
mattdjenkinson wants to merge 1 commit into
mattdjenkinson wants to merge 1 commit into
Conversation
PostQuery's text search and platform search need feedback in Milo's search service, which indexes resources from the audit events the apiserver now writes. - ResourceIndexPolicies for Post, Release and ChangelogEntry make titles, summaries and body text, categories, labels and post state searchable. Votes, trending, delivery and derived post lists stay unsearchable since they change as side effects. - A CEL condition keeps hidden posts out; the indexer removes a post from the index when an update makes it hidden. - Tests resolve every field path against the Go types, keep derived fields and private kinds out, and evaluate the hidden-post condition the way the indexer does. - hack/search-lag.sh measures how long a change takes to reach the index, for staging. Part of datum-cloud/enhancements#943 and #12; #12 stays open until the index lag is measured in staging.
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.
Makes posts, releases and changelog entries searchable in Milo's search service. PostQuery's
textsearch depends on it, and it also makes feedback findable through platform search. Part of #12. The issue stays open until the index lag is measured in staging, which needs the deploy in #13.Stacked on #30 (audit), which is on #29 down to #16.
Index policies (
config/milo/search)A
ResourceIndexPolicyfor each ofPost,ReleaseandChangelogEntry, included inconfig/milo:!has(spec.hidden) || !spec.hiddenkeeps hidden posts out. I checked the search indexer: an update that stops matching deletes the document, so hiding removes a post from the index. Re-indexing applies the same condition.How it connects
responseObjectin audit events, which the apiserver now writes atRequestResponsefor these kinds (feat: audit feedback writes from the apiserver #30).create resourcesearchqueriesgrant (feat: register feedback with Milo IAM #29) is enough.Measuring lag
hack/search-lag.sh <post>takes a visible post and times two things:It restores the post on exit. Hiding is briefly visible to users, so run it in staging after #13.
Testing
TestSearchPoliciesresolves every field path against the Go types by JSON name. A misspelled field fails, as checked by misspellingcodename. It also keeps derived fields and every kind but the three out.TestHiddenPostConditioncompiles the condition in the same CEL environment the indexer declares (metadata,specandstatusas dynamic values), and checks that a visible post is indexed and a hidden one isn't.textreturns it) is part of the staging work in Deploy to staging #13.