Showing
2 changed files
with
15 additions
and
0 deletions
@@ -16,6 +16,12 @@ public class ContentRequest extends BaseBean{ | @@ -16,6 +16,12 @@ public class ContentRequest extends BaseBean{ | ||
16 | */ | 16 | */ |
17 | private Integer cid; | 17 | private Integer cid; |
18 | /** | 18 | /** |
19 | + * 文章类型 | ||
20 | + * 1:男生 | ||
21 | + * 2:女生 | ||
22 | + */ | ||
23 | + private Integer app; | ||
24 | + /** | ||
19 | * 逗号分隔的tagId | 25 | * 逗号分隔的tagId |
20 | */ | 26 | */ |
21 | private String tagIds; | 27 | private String tagIds; |
@@ -48,6 +54,14 @@ public class ContentRequest extends BaseBean{ | @@ -48,6 +54,14 @@ public class ContentRequest extends BaseBean{ | ||
48 | this.cid = cid; | 54 | this.cid = cid; |
49 | } | 55 | } |
50 | 56 | ||
57 | + public Integer getApp() { | ||
58 | + return app; | ||
59 | + } | ||
60 | + | ||
61 | + public void setApp(Integer app) { | ||
62 | + this.app = app; | ||
63 | + } | ||
64 | + | ||
51 | public String getTagIds() { | 65 | public String getTagIds() { |
52 | return tagIds; | 66 | return tagIds; |
53 | } | 67 | } |
@@ -44,6 +44,7 @@ public class ContentService extends BaseService { | @@ -44,6 +44,7 @@ public class ContentService extends BaseService { | ||
44 | boolQuery.should(QueryBuilders.termQuery(ISearchConstans.CONTENT_TAG_IDS, tagId)); | 44 | boolQuery.should(QueryBuilders.termQuery(ISearchConstans.CONTENT_TAG_IDS, tagId)); |
45 | } | 45 | } |
46 | boolQuery.mustNot(QueryBuilders.termQuery(ISearchConstans.CONTENT_CID, request.getCid())); | 46 | boolQuery.mustNot(QueryBuilders.termQuery(ISearchConstans.CONTENT_CID, request.getCid())); |
47 | + boolQuery.must(QueryBuilders.termQuery(ISearchConstans.CONTENT_APP, request.getApp())); | ||
47 | // 构造query | 48 | // 构造query |
48 | searchParam.setQuery(boolQuery); | 49 | searchParam.setQuery(boolQuery); |
49 | return searchCommonService.doSearch(CONTENT_INDEX_NAME, searchParam); | 50 | return searchCommonService.doSearch(CONTENT_INDEX_NAME, searchParam); |
-
Please register or login to post a comment