File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
common-module/src/main/java/com/yapp/crew/domain/repository Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -97,13 +97,27 @@ private BooleanExpression isFilteredCity(long cityId) {
9797 }
9898
9999 private BooleanExpression isSearchedKeywords (List <String > keywords ) {
100- return Expressions .allOf (keywords .stream ().map (this ::isSearchedKeyword ).toArray (BooleanExpression []::new ));
100+ return Expressions .anyOf (keywords .stream ().map (keyword -> {
101+ BooleanExpression isContent = isSearchedKeywordInContent (keyword );
102+ BooleanExpression isTitle = isSearchedKeywordInTitle (keyword );
103+ BooleanExpression isNickname = isSearchedKeywordInUserNickname (keyword );
104+
105+ return Expressions .anyOf (isContent , isTitle , isNickname );
106+ }).toArray (BooleanExpression []::new ));
101107 }
102108
103- private BooleanExpression isSearchedKeyword (String keyword ) {
109+ private BooleanExpression isSearchedKeywordInContent (String keyword ) {
104110 return board .content .containsIgnoreCase (keyword );
105111 }
106112
113+ private BooleanExpression isSearchedKeywordInTitle (String keyword ) {
114+ return board .title .containsIgnoreCase (keyword );
115+ }
116+
117+ private BooleanExpression isSearchedKeywordInUserNickname (String keyword ) {
118+ return board .user .nickname .containsIgnoreCase (keyword );
119+ }
120+
107121 private BooleanExpression isDeletedBoard () {
108122 return board .status .ne (BoardStatus .CANCELED );
109123 }
You can’t perform that action at this time.
0 commit comments