summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/endpoints/posts/search.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/api/endpoints/posts/search.ts b/src/api/endpoints/posts/search.ts
index 6e26f55390..a36d1178a5 100644
--- a/src/api/endpoints/posts/search.ts
+++ b/src/api/endpoints/posts/search.ts
@@ -121,6 +121,15 @@ async function search(
text: x
});
} else {
+ const tags = text.split(' ').filter(x => x[0] == '#');
+ if (tags) {
+ push({
+ $and: tags.map(x => ({
+ tags: x
+ }))
+ });
+ }
+
push({
$and: text.split(' ').map(x => ({
// キーワードが-で始まる場合そのキーワードを除外する