diff options
author | Vitaly Takmazov | 2018-07-16 15:53:38 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-07-16 15:53:38 +0300 |
commit | 6afdad578701d38dd45d7d1c8ef446269f3a1275 (patch) | |
tree | c8259c0b047523b0b6035a8a1a2daa3a9016bb46 /juick-server/src/main/java/com/juick/server/api | |
parent | a8a32a0957ea014b1204b037164cb7d53cccd0c7 (diff) |
sphinx search: page by offset
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/Messages.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Messages.java b/juick-server/src/main/java/com/juick/server/api/Messages.java index b433bea5..eb562103 100644 --- a/juick-server/src/main/java/com/juick/server/api/Messages.java +++ b/juick-server/src/main/java/com/juick/server/api/Messages.java @@ -89,6 +89,7 @@ public class Messages { @RequestParam(required = false) String withrecommended, @RequestParam(required = false) String popular, @RequestParam(required = false) String search, + @RequestParam(required = false, defaultValue = "0") Integer page, @RequestParam(required = false) String media, @RequestParam(required = false) String tag) { @@ -112,7 +113,7 @@ public class Messages { } else if (daysback > 0) { mids = messagesService.getUserBlogAtDay(user.getUid(), 0, daysback); } else if (!StringUtils.isEmpty(search)) { - mids = messagesService.getUserSearch(user.getUid(), Utils.encodeSphinx(search), 0, before); + mids = messagesService.getUserSearch(user.getUid(), Utils.encodeSphinx(search), 0, page); } else { mids = messagesService.getUserBlog(user.getUid(), 0, before); } @@ -132,7 +133,7 @@ public class Messages { return NOT_FOUND; } } else if (!StringUtils.isEmpty(search)) { - mids = messagesService.getSearch(Utils.encodeSphinx(search), before); + mids = messagesService.getSearch(Utils.encodeSphinx(search), page); } else { mids = messagesService.getAll(visitor.getUid(), before); } |