Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

Add a search table over the whole metadata branch

6762a520b7af700dfebd7f613e1a610a42631139 · Keenan Nemetz · 10d ago · parent b739915c

Add a search table over the whole metadata branch

Search is the other thing the derived rows are for: one document per
issue, change request, and comment, with the title, the body and the
author. FTS5 tokenizes them, so a query ranks by relevance instead of
scanning every body, and `#42` or a ULID prefix is answered from the
numbering table first so the entity someone named comes first.

The documents are maintained by the same refresh as the list rows: an
entity's text is replaced with the entity, a thread's comments are
replaced with the thread, and a deletion removes both. A comment row
carries the parent's title and id, so a result can say what it is on and
link to the fragment without a second read.

The store never decides visibility: Search takes the repository ids the
caller may show, and returns nothing outside them.

This needs SQLite's FTS5 module. The build tag that enables it in the
driver's bundled copy is added to the build commands in the next commit;
a build without it fails at index.Open with that reason.

forge/index/issues.go +2−2

@@ -37,7 +37,7 @@ func insertIssue(tx execer, repoID string, iss *metadata.Issue) error {
37 37 return err
38 38 }
39 39 }
40 return nil
40 return indexDocument(tx, repoID, KindIssue, iss.ID, "", iss.Title, iss.Author, iss.Description)
41 41 }
42 42
43 43 // deleteIssue removes one issue's rows without touching its number. A number is
@@ -53,7 +53,7 @@ func deleteIssue(tx execer, repoID, id string) error {
53 53 return err
54 54 }
55 55 }
56 return nil
56 return deleteDocuments(tx, repoID, KindIssue, id)
57 57 }
58 58
59 59 func insertNumber(tx execer, repoID string, number int, kind, id string) error {