diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-17 11:11:22 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-17 11:11:22 +0900 |
| commit | 9f81288fccdbaf9184d49e61680747945b34f23d (patch) | |
| tree | dce25db34136ffd9c05852ed4c2c493c23c96c07 /src/api/endpoints/posts/search.js | |
| parent | Fix bug (diff) | |
| download | misskey-9f81288fccdbaf9184d49e61680747945b34f23d.tar.gz misskey-9f81288fccdbaf9184d49e61680747945b34f23d.tar.bz2 misskey-9f81288fccdbaf9184d49e61680747945b34f23d.zip | |
Fix bug
Diffstat (limited to 'src/api/endpoints/posts/search.js')
| -rw-r--r-- | src/api/endpoints/posts/search.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/api/endpoints/posts/search.js b/src/api/endpoints/posts/search.js index 0f214ef7ae..239517b993 100644 --- a/src/api/endpoints/posts/search.js +++ b/src/api/endpoints/posts/search.js @@ -65,8 +65,7 @@ async function byNative(res, rej, me, query, offset, max) { }, limit: max, skip: offset - }) - .toArray(); + }); // Serialize res(await Promise.all(posts.map(async post => @@ -120,12 +119,11 @@ async function byElasticsearch(res, rej, me, query, offset, max) { _id: { $in: hits } - }, {}, { + }, { sort: { _id: -1 } - }) - .toArray(); + }); posts.map(post => { post._highlight = response.hits.hits.filter(hit => post._id.equals(hit._id))[0].highlight.text[0]; |