mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-06 17:36:47 +08:00
关键字查询-中文查询异常
This commit is contained in:
@@ -407,7 +407,7 @@ public class CourseElasticsearchImpl implements ICourseFullTextSearch{
|
||||
BoolQueryBuilder keywordQuery = QueryBuilders.boolQuery();
|
||||
keywordQuery.should(QueryBuilders.wildcardQuery("name", "*"+words+"*").boost(9f));
|
||||
keywordQuery.should(QueryBuilders.wildcardQuery("teacher", "*"+words+"*").boost(7f));
|
||||
keywordQuery.should(QueryBuilders.wildcardQuery("keywords", "*"+words+"*").boost(9f));
|
||||
keywordQuery.should(QueryBuilders.wildcardQuery("keywords.keyword", "*"+words+"*").boost(9f));
|
||||
//keywordQuery.should(QueryBuilders.queryStringQuery(words).field("name", 9f));//用此方法无法查询出有转义符的处理
|
||||
//keywordQuery.should(QueryBuilders.queryStringQuery(words).field("teacher", 8f));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user