Monorepo for Tangled tangled.org

appview: add basic issue indexer (wip) #494

merged opened by boltless.me targeting master from boltless.me/core: feat/search
  • Heavily inspired by gitea
  • add GetAllIssues which only receives a paginator and gathers all issues ignoring repoAt field

Signed-off-by: Seongmin Lee boltlessengineer@proton.me

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3lwecnvoz4z22
+22 -22
Interdiff #11 #12
.gitignore

This file has not been changed.

appview/indexer/base36/base36.go

This file has not been changed.

appview/indexer/bleve/batch.go

This file has not been changed.

appview/indexer/bleve/query.go

This file has not been changed.

appview/indexer/indexer.go

This file has not been changed.

appview/indexer/issues/indexer.go

This file has not been changed.

appview/indexer/notifier.go

This file has not been changed.

appview/issues/issues.go

This patch was likely rebased, as context lines do not match.

appview/models/search.go

This file has not been changed.

appview/pages/pages.go

This patch was likely rebased, as context lines do not match.

+22 -22
appview/pagination/page.go
··· 30 30 } 31 31 } 32 32 33 - func IterateAll[T any]( 34 - fetch func(page Page) ([]T, error), 35 - handle func(items []T) error, 36 - ) error { 37 - page := FirstPage() 38 - for { 39 - items, err := fetch(page) 40 - if err != nil { 41 - return err 42 - } 43 33 44 - err = handle(items) 45 - if err != nil { 46 - return err 47 - } 48 - if len(items) < page.Limit { 49 - break 50 - } 51 - page = page.Next() 52 - } 53 - return nil 54 - } 55 34 56 35 57 36 ··· 70 49 71 50 72 51 52 + Limit: p.Limit, 53 + } 54 + } 73 55 56 + func IterateAll[T any]( 57 + fetch func(page Page) ([]T, error), 58 + handle func(items []T) error, 59 + ) error { 60 + page := FirstPage() 61 + for { 62 + items, err := fetch(page) 63 + if err != nil { 64 + return err 65 + } 74 66 75 - Limit: p.Limit, 67 + err = handle(items) 68 + if err != nil { 69 + return err 70 + } 71 + if len(items) < page.Limit { 72 + break 73 + } 74 + page = page.Next() 76 75 } 76 + return nil 77 77 }
appview/state/router.go

This file has not been changed.

appview/state/state.go

This file has not been changed.

History

15 rounds 2 comments
sign up or login to add to the discussion
1 commit
expand
appview: add basic issue indexer
expand 0 comments
pull request successfully merged
1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer
expand 1 comment

this changeset largely lgtm!

1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer
expand 1 comment
  • this is an N+1 query, because we first get all issues and then make one query for each issue. understandably this only needs to happen when populating the indices but we could improve this by just making one query
  • we can use a pagination free API for getting issues with comments while populating indexer
  • more of a note to self: search index should also handle issue deletions
1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer
expand 0 comments
1 commit
expand
appview: add basic issue indexer (wip)
expand 0 comments