Skip to content

Commit

Permalink
fix(topicdata): use AND instead of OR on topic data search
Browse files Browse the repository at this point in the history
close #1079
  • Loading branch information
tchiotludo committed Apr 26, 2022
1 parent c264f28 commit 49cf846
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/main/java/org/akhq/repositories/RecordRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -796,12 +796,11 @@ private static boolean equalsAll(String search, Collection<String> in) {
String[] split = search.toLowerCase().split("\\s");
for (String s : in) {
if(s != null) {
s = s.toLowerCase();
for (String k : split) {
if (s.equals(k)) {
return true;
}
}
final String lowerS = s.toLowerCase();

return Stream.of(split)
.filter(lowerS::equals)
.count() == split.length;
}
}
return false;
Expand All @@ -817,12 +816,11 @@ private static boolean notContainsAll(String search, Collection<String> in) {
String[] split = search.toLowerCase().split("\\s");
for (String s : in) {
if(s != null) {
s = s.toLowerCase();
for (String k : split) {
if (s.contains(k)) {
return false;
}
}
final String lowerS = s.toLowerCase();

return Stream.of(split)
.filter(lowerS::contains)
.count() == split.length;
}
}
return true;
Expand Down

0 comments on commit 49cf846

Please sign in to comment.