summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-02-26 01:06:21 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-02-26 01:06:21 +0900
commit9292df217caae4c4f6d33be3aeb0805a003c7511 (patch)
treee8abf791ac74a26b8b177ebbf3cfbbffee377567 /src/api
parentv3888 (diff)
downloadsharkey-9292df217caae4c4f6d33be3aeb0805a003c7511.tar.gz
sharkey-9292df217caae4c4f6d33be3aeb0805a003c7511.tar.bz2
sharkey-9292df217caae4c4f6d33be3aeb0805a003c7511.zip
:v:
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 => ({
// キーワードが-で始まる場合そのキーワードを除外する