Subversion Repositories SmartDukaan

Rev

Rev 27006 | Rev 27018 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27006 Rev 27017
Line 296... Line 296...
296
			parentFilter.add("subCategoryId_i:" + subCategoryId);
296
			parentFilter.add("subCategoryId_i:" + subCategoryId);
297
		}
297
		}
298
		if (StringUtils.isNotBlank(brand)) {
298
		if (StringUtils.isNotBlank(brand)) {
299
			parentFilter.add("brand_ss:" + brand);
299
			parentFilter.add("brand_ss:" + brand);
300
		}
300
		}
-
 
301
		if (queryTerm == "") {
-
 
302
			params.put("sort", "create_s desc");
-
 
303
		} else {
-
 
304
			parentFilter.add(queryTerm);
-
 
305
		}
301
		String parentFilterString = "\"" + String.join(" AND ", parentFilter) + "\"";
306
		String parentFilterString = "\"" + String.join(" AND ", parentFilter) + "\"";
302
		String childFilterString = String.join(" AND ", childFilter);
307
		String childFilterString = String.join(" AND ", childFilter);
303
		logger.info(parentFilterString);
308
		logger.info(parentFilterString);
304
		params.put("q", String.format("%s{!parent which=%s}%s", queryTerm, parentFilterString, childFilterString));
309
		params.put("q", String.format("{!parent which=%s}%s", parentFilterString, childFilterString));
305
		params.put("fl",
310
		params.put("fl",
306
				String.format("*, [child parentFilter=id:catalog* childFilter=%s]", "\"" + childFilterString + "\""));
311
				String.format("*, [child parentFilter=id:catalog* childFilter=%s]", "\"" + childFilterString + "\""));
307
		if (queryTerm == "") {
-
 
308
			params.put("sort", "create_s desc");
-
 
309
		}
-
 
310
		params.put("start", String.valueOf(offset));
312
		params.put("start", String.valueOf(offset));
311
		params.put("rows", String.valueOf(limit));
313
		params.put("rows", String.valueOf(limit));
312
		params.put("wt", "json");
314
		params.put("wt", "json");
313
		String response = null;
315
		String response = null;
314
		try {
316
		try {