mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Compare commits
3 commits
d79292c8f6
...
51642db93e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51642db93e | ||
|
|
24d27c4cdd | ||
|
|
96799d1918 |
1 changed files with 7 additions and 2 deletions
|
|
@ -80,15 +80,20 @@ export class DittoPgStore extends NPostgres {
|
||||||
|
|
||||||
/** Conditions for when to index certain tags. */
|
/** Conditions for when to index certain tags. */
|
||||||
static tagConditions: Record<string, TagCondition> = {
|
static tagConditions: Record<string, TagCondition> = {
|
||||||
|
'A': ({ count }) => count === 0,
|
||||||
|
'E': ({ count, value }) => count === 0 && isNostrId(value),
|
||||||
|
'I': ({ count }) => count === 0,
|
||||||
|
'K': ({ count, value }) => count === 0 && Number.isInteger(Number(value)),
|
||||||
|
'L': ({ event, count }) => event.kind === 1985 || count === 0,
|
||||||
|
'P': ({ count, value }) => count === 0 && isNostrId(value),
|
||||||
'a': ({ count }) => count < 15,
|
'a': ({ count }) => count < 15,
|
||||||
'client': ({ count, value }) => count === 0 && value.length < 50,
|
'client': ({ count, value }) => count === 0 && value.length < 50,
|
||||||
'd': ({ event, count }) => count === 0 && NKinds.parameterizedReplaceable(event.kind),
|
'd': ({ event, count }) => count === 0 && NKinds.parameterizedReplaceable(event.kind),
|
||||||
'e': DittoPgStore.eTagCondition,
|
'e': DittoPgStore.eTagCondition,
|
||||||
|
'i': ({ count }) => count < 15,
|
||||||
'k': ({ count }) => count < 3,
|
'k': ({ count }) => count < 3,
|
||||||
'L': ({ event, count }) => event.kind === 1985 || count === 0,
|
|
||||||
'l': ({ event, count }) => event.kind === 1985 || count === 0,
|
'l': ({ event, count }) => event.kind === 1985 || count === 0,
|
||||||
'n': ({ count, value }) => count < 50 && value.length < 50,
|
'n': ({ count, value }) => count < 50 && value.length < 50,
|
||||||
'P': ({ count, value }) => count === 0 && isNostrId(value),
|
|
||||||
'p': DittoPgStore.pTagCondition,
|
'p': DittoPgStore.pTagCondition,
|
||||||
'proxy': ({ count, value }) => count === 0 && value.length < 256,
|
'proxy': ({ count, value }) => count === 0 && value.length < 256,
|
||||||
'q': ({ event, count, value }) => count === 0 && event.kind === 1 && isNostrId(value),
|
'q': ({ event, count, value }) => count === 0 && event.kind === 1 && isNostrId(value),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue