Index hashtags and mentions
This commit is contained in:
parent
36bc93cfda
commit
52bc600832
5 changed files with 66 additions and 16 deletions
11
core/meta.py
11
core/meta.py
|
@ -46,6 +46,9 @@ class MetaKey(Enum):
|
|||
OBJECT_ACTOR_HASH = "object_actor_hash"
|
||||
PUBLIC = "public"
|
||||
|
||||
HASHTAGS = "hashtags"
|
||||
MENTIONS = "mentions"
|
||||
|
||||
FOLLOW_STATUS = "follow_status"
|
||||
|
||||
THREAD_ROOT_PARENT = "thread_root_parent"
|
||||
|
@ -121,6 +124,14 @@ def is_public() -> _SubQuery:
|
|||
return flag(MetaKey.PUBLIC, True)
|
||||
|
||||
|
||||
def by_visibility(vis: ap.Visibility) -> _SubQuery:
|
||||
return flag(MetaKey.VISIBILITY, vis.name)
|
||||
|
||||
|
||||
def by_hashtag(ht: str) -> _SubQuery:
|
||||
return flag(MetaKey.HASHTAGS, ht)
|
||||
|
||||
|
||||
def inc(mk: MetaKey, val: int) -> _SubQuery:
|
||||
return {"$inc": flag(mk, val)}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue