|
@@ -3,6 +3,7 @@ package com.winhc.phoenix.example.service.impl;
|
|
import com.winhc.phoenix.example.dao.SearchDao;
|
|
import com.winhc.phoenix.example.dao.SearchDao;
|
|
import com.winhc.phoenix.example.service.LegislationService;
|
|
import com.winhc.phoenix.example.service.LegislationService;
|
|
import com.winhc.phoenix.example.util.BigDecimalUtil;
|
|
import com.winhc.phoenix.example.util.BigDecimalUtil;
|
|
|
|
+import com.winhc.phoenix.example.util.QueryBuilderUtils;
|
|
import com.winhc.phoenix.example.util.company.search.CompanyIndexUtils;
|
|
import com.winhc.phoenix.example.util.company.search.CompanyIndexUtils;
|
|
import com.winhc.phoenix.example.vo.legislation.LegislationSearchType;
|
|
import com.winhc.phoenix.example.vo.legislation.LegislationSearchType;
|
|
import com.winhc.phoenix.example.vo.legislation.LegislationSearchVo;
|
|
import com.winhc.phoenix.example.vo.legislation.LegislationSearchVo;
|
|
@@ -36,7 +37,7 @@ public class LegislationServiceImpl implements LegislationService {
|
|
|
|
|
|
|
|
|
|
private final SearchDao searchDao;
|
|
private final SearchDao searchDao;
|
|
- public static final String index = "legislation_info_fx_v1";
|
|
|
|
|
|
+ public static final String index = "legislation_info_fx_v3";
|
|
public static final String type = "legislation_info_fx_type";
|
|
public static final String type = "legislation_info_fx_type";
|
|
|
|
|
|
private static final List<String> highlightField = new ArrayList<String>() {{
|
|
private static final List<String> highlightField = new ArrayList<String>() {{
|
|
@@ -72,37 +73,31 @@ public class LegislationServiceImpl implements LegislationService {
|
|
);
|
|
);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
|
|
+ boolQuery.should(matchQuery("title", content).boost(0))
|
|
|
|
+ .should(termQuery("title.keyword", content).boost(0))
|
|
|
|
+ ;
|
|
|
|
+ boolQuery.should(matchPhraseQuery("content", content).boost(10))
|
|
|
|
+ .should(matchQuery("content", content).minimumShouldMatch("100%").boost(5))
|
|
|
|
+ .should(matchQuery("content", content).boost(0));
|
|
|
|
|
|
|
|
+ boolQuery.should(disMaxQuery()
|
|
|
|
+ .add(matchPhraseQuery("title_keyword", content).boost(20))
|
|
|
|
+ .add(QueryBuilderUtils.spanNearQuery4StandardAnalyzer("title_keyword.standard", content).boost(20))
|
|
|
|
+ .add(termQuery("title_keyword.keyword", content).boost(20))
|
|
|
|
|
|
- boolQuery.should(boolQuery().filter(boolQuery()
|
|
|
|
-// .should(matchQuery("content", content).minimumShouldMatch("100%"))
|
|
|
|
- .should(matchQuery("title", content))
|
|
|
|
- .should(termQuery("title.keyword", content))
|
|
|
|
- ).boost(0));
|
|
|
|
-
|
|
|
|
- boolQuery.should(boolQuery().filter(boolQuery()
|
|
|
|
- .should(matchPhraseQuery("content", content))
|
|
|
|
- ).boost(25));
|
|
|
|
-
|
|
|
|
- boolQuery.should(boolQuery().filter(boolQuery()
|
|
|
|
- .should(matchQuery("content", content).boost(20).minimumShouldMatch("100%"))
|
|
|
|
- ).boost(20));
|
|
|
|
-
|
|
|
|
- boolQuery.should(boolQuery().filter(boolQuery()
|
|
|
|
- .should(matchQuery("content", content))
|
|
|
|
- ).boost(2));
|
|
|
|
-
|
|
|
|
|
|
+ .add(QueryBuilderUtils.spanNearQuery4StandardAnalyzer("title.standard", content).boost(20))
|
|
|
|
+// .add(matchQuery("title.trim", content).boost(20).minimumShouldMatch("100%"))
|
|
|
|
+ .add(termQuery("title.keyword", content).boost(100))
|
|
|
|
+ .tieBreaker(0.3f)
|
|
|
|
+ );
|
|
|
|
|
|
- boolQuery.should(boolQuery().should(disMaxQuery()
|
|
|
|
-// .add(matchPhraseQuery("content", content).boost(25))
|
|
|
|
-// .add(matchQuery("content", content).boost(20).minimumShouldMatch("100%"))
|
|
|
|
-// .add(matchQuery("content", content).boost(2))
|
|
|
|
- .add(disMaxQuery()
|
|
|
|
|
|
+ /*boolQuery.should(
|
|
|
|
+ disMaxQuery()
|
|
.add(matchQuery("title.standard", content).minimumShouldMatch("100%").boost(20))
|
|
.add(matchQuery("title.standard", content).minimumShouldMatch("100%").boost(20))
|
|
.add(matchQuery("title.trim", content).boost(20).minimumShouldMatch("100%"))
|
|
.add(matchQuery("title.trim", content).boost(20).minimumShouldMatch("100%"))
|
|
.add(termQuery("title.keyword", content).boost(100))
|
|
.add(termQuery("title.keyword", content).boost(100))
|
|
- .tieBreaker(0.3f))
|
|
|
|
- ));
|
|
|
|
|
|
+ .tieBreaker(0.3f)
|
|
|
|
+ );*/
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|