Skip to content

Commit

Permalink
Merge pull request #137 from LionnoiL/195-fix-unactive-advertisements…
Browse files Browse the repository at this point in the history
…-in-search

MP-195 fix "NO ACTIVE" Advertisements Appear in Search Functionality
  • Loading branch information
LionnoiL authored May 18, 2024
2 parents d4e3c5b + a250ab9 commit 5a3a220
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ private BooleanPredicateClausesStep<?> buildSearchQueryWithFilters(
List<Long> statesIds, List<Long> cityIds, BigDecimal minPrice, BigDecimal maxPrice) {
BooleanPredicateClausesStep<?> queryStep = f.bool();
queryStep.mustNot(f.terms().field("author.status").matchingAny(UserStatus.DELETED));
queryStep.must(f.terms().field("status").matchingAny(AdvertisementStatus.ACTIVE));

if (categoryId != null) {
queryStep.must(f.terms().field("category.id").matchingAny(categoryId));
Expand Down

0 comments on commit 5a3a220

Please sign in to comment.