|
@@ -45,17 +45,20 @@ public class LegislationServiceImpl implements LegislationService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Object search(String content, int from, int size) {
|
|
public Object search(String content, int from, int size) {
|
|
|
|
+ log.info("search legislation keyword: {}", content);
|
|
|
|
+
|
|
BoolQueryBuilder boolQuery = boolQuery();
|
|
BoolQueryBuilder boolQuery = boolQuery();
|
|
|
|
|
|
boolQuery.filter(boolQuery()
|
|
boolQuery.filter(boolQuery()
|
|
- .should(matchQuery("content", content).minimumShouldMatch("100%"))
|
|
|
|
- .should(matchQuery("title", content))
|
|
|
|
- .should(termQuery("title.keyword", content))
|
|
|
|
- .should(matchQuery("title.standard", content).minimumShouldMatch("100%"))
|
|
|
|
|
|
+ .should(matchQuery("content", content).minimumShouldMatch("100%"))
|
|
|
|
+ .should(matchQuery("title", content))
|
|
|
|
+ .should(termQuery("title.keyword", content))
|
|
|
|
+// .should(matchQuery("title.standard", content).minimumShouldMatch("100%"))
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
boolQuery.should(disMaxQuery()
|
|
boolQuery.should(disMaxQuery()
|
|
|
|
+ .add(matchQuery("title.standard", content).minimumShouldMatch("100%").boost(20))
|
|
.add(matchQuery("title.trim", content).boost(20))
|
|
.add(matchQuery("title.trim", content).boost(20))
|
|
.add(termQuery("title.keyword", content).boost(100))
|
|
.add(termQuery("title.keyword", content).boost(100))
|
|
.tieBreaker(0.3f)
|
|
.tieBreaker(0.3f)
|