Subversion Repositories SmartDukaan

Rev

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

Rev 24974 Rev 24975
Line 196... Line 196...
196
			List<Integer> tagIds = pricingService.getTagsIdsByRetailerId(uc.getUserId());
196
			List<Integer> tagIds = pricingService.getTagsIdsByRetailerId(uc.getUserId());
197
			RestClient rc = new RestClient();
197
			RestClient rc = new RestClient();
198
			Map<String, String> params = new HashMap<>();
198
			Map<String, String> params = new HashMap<>();
199
			List<String> mandatoryQ = new ArrayList<>();
199
			List<String> mandatoryQ = new ArrayList<>();
200
			if (queryTerm != null && !queryTerm.equals("null")) {
200
			if (queryTerm != null && !queryTerm.equals("null")) {
201
				mandatoryQ.add(String.format("+(%s) ", queryTerm));
201
				mandatoryQ.add(String.format("+(%s)", queryTerm));
-
 
202
			} else {
-
 
203
				queryTerm = null;
202
			}
204
			}
203
			if (brand != null) {
205
			if (brand != null) {
204
 
206
 
205
				mandatoryQ.add(
207
				mandatoryQ.add(
206
						String.format("+(categoryId_i:%s) +(brand_ss:%s) +{!parent which=\"brand_ss:%s\"} tagId_i:(%s)",
208
						String.format("+(categoryId_i:%s) +(brand_ss:%s) +{!parent which=\"brand_ss:%s\"} tagId_i:(%s)",
Line 217... Line 219...
217
				mandatoryQ.add(
219
				mandatoryQ.add(
218
						String.format("+{!parent which=\"id:catalog*\"} tagId_i:(%s)", StringUtils.join(tagIds, " ")));
220
						String.format("+{!parent which=\"id:catalog*\"} tagId_i:(%s)", StringUtils.join(tagIds, " ")));
219
			}
221
			}
220
			params.put("q", StringUtils.join(mandatoryQ, " "));
222
			params.put("q", StringUtils.join(mandatoryQ, " "));
221
			params.put("fl", "*, [child parentFilter=id:catalog*]");
223
			params.put("fl", "*, [child parentFilter=id:catalog*]");
-
 
224
			if(queryTerm==null) {
222
			params.put("sort", "rank_i asc, create_s desc");
225
				params.put("sort", "create_s desc");
-
 
226
			}
223
			params.put("start", String.valueOf(offset));
227
			params.put("start", String.valueOf(offset));
224
			params.put("rows", String.valueOf(limit));
228
			params.put("rows", String.valueOf(limit));
225
			params.put("wt", "json");
229
			params.put("wt", "json");
226
			String response = null;
230
			String response = null;
227
			try {
231
			try {