From a8a32a0957ea014b1204b037164cb7d53cccd0c7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 16 Jul 2018 14:47:46 +0300 Subject: sphinx search: sort by weight first --- juick-server/src/main/java/com/juick/service/SphinxSearchService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'juick-server/src/main/java/com/juick/service') diff --git a/juick-server/src/main/java/com/juick/service/SphinxSearchService.java b/juick-server/src/main/java/com/juick/service/SphinxSearchService.java index f102ab47..f2f31295 100644 --- a/juick-server/src/main/java/com/juick/service/SphinxSearchService.java +++ b/juick-server/src/main/java/com/juick/service/SphinxSearchService.java @@ -46,7 +46,7 @@ public class SphinxSearchService extends BaseJdbcService implements SearchServic Map sphinxQuery = new HashMap<>(); sphinxQuery.put("limit", String.valueOf(maxResult)); sphinxQuery.put("mode", "any"); - sphinxQuery.put("sort", "extended:@id desc"); + sphinxQuery.put("sort", "extended:@weight desc, @id desc"); if (messageIdBefore > 0) { sphinxQuery.put("maxid", String.valueOf(messageIdBefore - 1)); } @@ -65,7 +65,7 @@ public class SphinxSearchService extends BaseJdbcService implements SearchServic Map sphinxQuery = new HashMap<>(); sphinxQuery.put("limit", String.valueOf(maxResult)); sphinxQuery.put("mode", "any"); - sphinxQuery.put("sort", "extended:@id desc"); + sphinxQuery.put("sort", "extended:@weight desc, @id desc"); if (messageIdBefore > 0) { sphinxQuery.put("maxid", String.valueOf(messageIdBefore - 1)); } -- cgit v1.2.3