| Line 181... |
Line 181... |
| 181 |
}
|
181 |
}
|
| 182 |
|
182 |
|
| 183 |
public JSONArray getSolrDocs(String queryTerm, String categoryId, int offset, int limit, String sort,
|
183 |
public JSONArray getSolrDocs(String queryTerm, String categoryId, int offset, int limit, String sort,
|
| 184 |
String brand, int subCategoryId, boolean hotDeal, boolean group, boolean eol_filter,
|
184 |
String brand, int subCategoryId, boolean hotDeal, boolean group, boolean eol_filter,
|
| 185 |
List<String> excludeBrands) throws Throwable {
|
185 |
List<String> excludeBrands) throws Throwable {
|
| - |
|
186 |
return getSolrDocs(queryTerm, categoryId, offset, limit, sort, brand, subCategoryId, hotDeal, group,
|
| - |
|
187 |
eol_filter, excludeBrands, null);
|
| - |
|
188 |
}
|
| - |
|
189 |
|
| - |
|
190 |
public JSONArray getSolrDocs(String queryTerm, String categoryId, int offset, int limit, String sort,
|
| - |
|
191 |
String brand, int subCategoryId, boolean hotDeal, boolean group, boolean eol_filter,
|
| - |
|
192 |
List<String> excludeBrands, List<Integer> hotDealCatalogIds) throws Throwable {
|
| 186 |
List<String> parentFilter = new ArrayList<>();
|
193 |
List<String> parentFilter = new ArrayList<>();
|
| 187 |
parentFilter.add("categoryId_i:" + categoryId);
|
194 |
parentFilter.add("categoryId_i:" + categoryId);
|
| 188 |
parentFilter.add("show_default_b:true");
|
195 |
parentFilter.add("show_default_b:true");
|
| 189 |
List<String> childFilter = new ArrayList<>();
|
196 |
List<String> childFilter = new ArrayList<>();
|
| 190 |
childFilter.add("itemId_i:*");
|
197 |
childFilter.add("itemId_i:*");
|
| Line 193... |
Line 200... |
| 193 |
if (queryTerm == null || queryTerm.equals("null")) {
|
200 |
if (queryTerm == null || queryTerm.equals("null")) {
|
| 194 |
queryTerm = "";
|
201 |
queryTerm = "";
|
| 195 |
} else {
|
202 |
} else {
|
| 196 |
queryTerm = "(" + queryTerm + ")";
|
203 |
queryTerm = "(" + queryTerm + ")";
|
| 197 |
}
|
204 |
}
|
| - |
|
205 |
if (hotDealCatalogIds != null && !hotDealCatalogIds.isEmpty()) {
|
| - |
|
206 |
// New model_hot_deal-driven hot deals: restrict parents to the active deal
|
| - |
|
207 |
// models; items stay the normal active set (old hot_deal_b flag not used)
|
| - |
|
208 |
String idClause = hotDealCatalogIds.stream().map(x -> "catalog" + x)
|
| - |
|
209 |
.collect(java.util.stream.Collectors.joining(" OR "));
|
| - |
|
210 |
parentFilter.add("id:(" + idClause + ")");
|
| - |
|
211 |
childFilter.add("active_b:true");
|
| 198 |
if (hotDeal) {
|
212 |
} else if (hotDeal) {
|
| 199 |
childFilter.add("hot_deal_b:true");
|
213 |
childFilter.add("hot_deal_b:true");
|
| 200 |
} else {
|
214 |
} else {
|
| 201 |
childFilter.add("active_b:true");
|
215 |
childFilter.add("active_b:true");
|
| 202 |
}
|
216 |
}
|
| 203 |
if (subCategoryId != 0) {
|
217 |
if (subCategoryId != 0) {
|