searchable中((A&&B)||(C&&D))的情况

Searchable searchable = new SearchRequest();
searchable.setPage(page - 1, rows);

OrCondition orCondition;
            
SearchFilter filterOne = SearchFilterHelper.newCondition("chuangjianrenid_eq", useID);
SearchFilter filterTwo = SearchFilterHelper.newCondition("zhuangtai_eq", 0);

SearchFilter filter = SearchFilterHelper.and(filterOne, filterTwo);

//
SearchFilter filter1 = SearchFilterHelper.newCondition("zdm_eq", useID);
// 
SearchFilter filter2 = SearchFilterHelper.newCondition("state_eq", state);

SearchFilter searchFilter = SearchFilterHelper.and(filter1, filter2);

orCondition = (OrCondition) SearchFilterHelper.or(filter);
orCondition.add(searchFilter);

searchable.addSearchFilter(orCondition);
this.find(searchable);

 

你可能感兴趣的:(searchable中((A&&B)||(C&&D))的情况)