Skip to content

Commit

Permalink
Fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
tutn-axonivy committed Jul 15, 2024
1 parent bd877c3 commit 6938583
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

import static com.axonivy.market.constants.CommonConstants.LOGO_FILE;
import static com.axonivy.market.constants.CommonConstants.SLASH;
import static com.axonivy.market.constants.MetaConstants.*;
import static com.axonivy.market.constants.MetaConstants.DEFAULT_VENDOR_NAME;
import static com.axonivy.market.constants.MetaConstants.DEFAULT_VENDOR_URL;
import static com.axonivy.market.constants.MetaConstants.META_FILE;
import static org.apache.commons.lang3.StringUtils.EMPTY;

import com.axonivy.market.enums.Language;
import com.axonivy.market.github.util.GitHubUtils;
import com.axonivy.market.model.DisplayValue;
import com.axonivy.market.model.MultilingualismValue;
import org.apache.commons.lang3.BooleanUtils;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
Expand All @@ -19,15 +15,17 @@
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.kohsuke.github.GHContent;
import org.springframework.util.CollectionUtils;

import com.axonivy.market.entity.Product;
import com.axonivy.market.github.model.Meta;
import com.axonivy.market.github.util.GitHubUtils;
import com.axonivy.market.model.DisplayValue;
import com.fasterxml.jackson.databind.ObjectMapper;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.util.CollectionUtils;

@Log4j2
@NoArgsConstructor(access = AccessLevel.PRIVATE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ public interface ProductRepository extends MongoRepository<Product, String> {

Optional<Product> findById(String productId);

Optional<Product> findById(String productId);
@Query("{'marketDirectory': {$regex : ?0, $options: 'i'}}")
Product findByMarketDirectoryRegex(String search);

@Query("{'marketDirectory': {$regex : ?0, $options: 'i'}}")
Product findByMarketDirectoryRegex(String search);
@Query("{ $and: [ { $or: [ { 'names.?': { $regex: ?0, $options: 'i' } }, { 'shortDescriptions.?': { $regex: ?0, $options: 'i' } } ] }, { 'type': ?1 } ] }")
Page<Product> searchByKeywordAndType(String keyword, String type, String language, Pageable unifiedPageabe);

@Query("{ $and: [ { $or: [ { 'names.?': { $regex: ?0, $options: 'i' } }, { 'shortDescriptions.?': { $regex: ?0, $options: 'i' } } ] }, { 'type': ?1 } ] }")
Page<Product> searchByKeywordAndType(String keyword, String type, String language, Pageable unifiedPageabe);

@Query("{ $or: [ { 'names.?1': { $regex: ?0, $options: 'i' } }, { 'shortDescriptions.?1': { $regex: ?0, $options: 'i' } } ] }")
Page<Product> searchByNameOrShortDescriptionRegex(String keyword, String language, Pageable unifiedPageabe);
@Query("{ $or: [ { 'names.?1': { $regex: ?0, $options: 'i' } }, { 'shortDescriptions.?1': { $regex: ?0, $options: 'i' } } ] }")
Page<Product> searchByNameOrShortDescriptionRegex(String keyword, String language, Pageable unifiedPageabe);
}

0 comments on commit 6938583

Please sign in to comment.