main
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6f92d377e7 |
one search across every store the operator's decisions live in
GET /admin-api/find?q=<text>&limit=<n> asks where a phrase appears in one call: blocks (key, reason, last path), ranges (match, reason), exemptions (match, note), path rules and path budgets (pattern, note), alerts (kind, key, detail, last path), change records (target, detail) and country rules (code, name). Each row names the store it came from, what it is keyed by, when it was written, whether it is in force, the text that matched and the field it matched in. The phrase an operator remembers - a ticket number, a customer's name - is not a field any listing filters on, so asking it used to mean opening eight listings and reading every row. Rulings: - the query is data, not LIKE's grammar. The backslash, the percent and the underscore are escaped and the match runs LIKE ... ESCAPE '\', so "100%" searches the four characters "100%" and not "anything after 100". Unescaped, a percent inside an operator's own sentence answers about rows nobody asked about; the gate searches 100%, a_b and a literal backslash to hold this. - an address query returns the rows that COVER it, not only the rows that name it - the part a grep cannot do. Searching .69 returns the /29 that refuses it although no row contains that address, and the row says so: "203.0.113.64/29 covers 203.0.113.69". Blocks are matched on the key this edge files the address under, the rule the dossier and the story both had to learn: with a /29 key, searching .90 finds the ban stored as 203.0.113.88/29. - a row that matches by text and also covers the address is answered once, with the text match as its reason: the row really does name the query. - counts is per store and is that store's whole answer, not the rows this call happened to return, so matched: 0 over eight zeroed stores is a different sentence from a surface that read nothing - and a limit truncates the merged answer without pretending a store had nothing else in it. - rows come newest-first. This is a search, not a story: the row an operator wants is the one they wrote last. /history reads oldest-first because it narrates, and neither default is wrong for the other question. - q is 2..128 characters - one character is a dump rather than an answer, and 128 is the longest target the change log stores, so a longer query cannot match the thing it was aimed at. limit is 100 by default, 500 at most. An unknown query parameter is refused by name. Country rules are searched by name as well as by code: "Ukraine" is what an operator remembers, "UA" is what the row stores. - it is a read. The read-only token can ask it, and eight asks leave every store holding the same rows. The console carries the same call: a phrase in, one line per row that carries it, and a header counting all eight stores so an empty answer reads as an answer. Gates: build 0/0, unit 377/377, integration 394/394 (11 new), console 159 assertions 0 failed (+8), smoke 243/0 (+13), compose 339/0 (+8), image 262 MB. |