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/requests.go +2−2

@@ -217,7 +217,7 @@ func insertRequest(tx execer, repoID string, req *metadata.Request) error {
217 217 return err
218 218 }
219 219 }
220 return nil
220 return indexDocument(tx, repoID, KindRequest, req.ID, "", req.Title, req.Author, req.Description)
221 221 }
222 222
223 223 // deleteRequest removes one request's rows. Approvals and closes of a request
@@ -234,7 +234,7 @@ func deleteRequest(tx execer, repoID, id string) error {
234 234 return err
235 235 }
236 236 }
237 return nil
237 return deleteDocuments(tx, repoID, KindRequest, id)
238 238 }
239 239
240 240 // unixOrZero keeps an absent timestamp as 0 rather than the Unix time of the