eventstore: index tag letter together with the value.

This commit is contained in:
fiatjaf
2025-06-10 13:46:29 -03:00
parent 287d8c23c7
commit e9a08d669e
8 changed files with 250 additions and 98 deletions

View File

@@ -118,11 +118,10 @@ func (b *LMDBBackend) prepareQueries(filter nostr.Filter) (
queries = make([]query, len(tagValues))
for i, value := range tagValues {
// get key prefix (with full length) and offset where to write the created_at
dbi, k, offset := b.getTagIndexPrefix(value)
dbi, k, offset := b.getTagIndexPrefix(tagKey, value)
// remove the last parts part to get just the prefix we want here
prefix := k[0:offset]
queries[i] = query{i: i, dbi: dbi, prefix: prefix, keySize: len(prefix) + 4, timestampSize: 4}
i++
}
// add an extra kind filter if available (only do this on plain tag index, not on ptag-kind index)