|
@@ -55,12 +55,12 @@ public class QAProblemService extends ServiceImpl<QAProblemMapper,QAProblem> imp
|
|
BoolQueryBuilder queryBuilder = boolQuery().
|
|
BoolQueryBuilder queryBuilder = boolQuery().
|
|
must(termQuery("state", 1)).
|
|
must(termQuery("state", 1)).
|
|
must(boolQuery().
|
|
must(boolQuery().
|
|
- should(matchQuery("tags", keyword).boost(100)).
|
|
|
|
- should(matchQuery("tags.pinyin", keyword).boost(90)).
|
|
|
|
- should(matchQuery("title", keyword).boost(10)).
|
|
|
|
- should(matchQuery("title.pinyin", keyword).boost(9)).
|
|
|
|
- should(matchQuery("describe", keyword)).
|
|
|
|
- should(matchQuery("describe.pinyin", keyword))
|
|
|
|
|
|
+ should(matchQuery("tags", keyword).boost(10)).
|
|
|
|
+// should(matchQuery("tags.pinyin", keyword).boost(90)).
|
|
|
|
+ should(matchQuery("title", keyword).boost(5))
|
|
|
|
+// should(matchQuery("title.pinyin", keyword).boost(9)).
|
|
|
|
+// should(matchQuery("describe", keyword)).
|
|
|
|
+// should(matchQuery("describe.pinyin", keyword))
|
|
);
|
|
);
|
|
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder().query(queryBuilder);
|
|
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder().query(queryBuilder);
|
|
SearchRequest request = new SearchRequest("qa_problem").source(sourceBuilder);
|
|
SearchRequest request = new SearchRequest("qa_problem").source(sourceBuilder);
|