Skip to content

Commit

Permalink
perf: 优化标签页面搜索
Browse files Browse the repository at this point in the history
  • Loading branch information
jamebal committed May 20, 2024
1 parent c2fa83a commit fe39093
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ private Query getQuery(SearchDTO searchDTO) throws ParseException {
continue;
}
regexpQueryBuilder.add(new BoostQuery(new RegexpQuery(new Term(field, ".*" + keyword + ".*")), boosts.get(field)), BooleanClause.Occur.SHOULD);
// regexpQueryBuilder.add(new BoostQuery(new WildcardQuery(new Term("field", "*" + keyword + "*")), boosts.get(field)), BooleanClause.Occur.SHOULD);
}
Query regExpQuery = regexpQueryBuilder.build();
BoostQuery boostedRegExpQuery = new BoostQuery(regExpQuery, 10.0f);
Expand Down Expand Up @@ -558,7 +557,7 @@ private void otherQueryParams(SearchDTO searchDTO, BooleanQuery.Builder builder)
if (searchDTO.getTagId() != null) {
TagDO tagDO = tagService.getTagInfo(searchDTO.getTagId());
if (tagDO != null) {
builder.add(new TermQuery(new Term("tag", tagDO.getName())), BooleanClause.Occur.MUST);
builder.add(new RegexpQuery(new Term("tag", ".*" + tagDO.getName() + ".*")), BooleanClause.Occur.MUST);
}
}
if (StrUtil.isNotBlank(searchDTO.getCurrentDirectory()) && searchDTO.getCurrentDirectory().length() > 1) {
Expand Down

0 comments on commit fe39093

Please sign in to comment.