Subversion Repositories SmartDukaan

Rev

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

Rev 26574 Rev 26575
Line 277... Line 277...
277
			params.put("start", String.valueOf(offset));
277
			params.put("start", String.valueOf(offset));
278
			params.put("rows", String.valueOf(limit));
278
			params.put("rows", String.valueOf(limit));
279
			params.put("wt", "json");
279
			params.put("wt", "json");
280
			String response = null;
280
			String response = null;
281
			try {
281
			try {
282
				response = rc.get(SchemeType.HTTP, "dtr", 8984, "solr/demo/select", params);
282
				response = rc.get(SchemeType.HTTP, "50.116.10.120", 8984, "solr/demo/select", params);
283
			} catch (HttpHostConnectException e) {
283
			} catch (HttpHostConnectException e) {
284
				throw new ProfitMandiBusinessException("", "", "Could not connect to host");
284
				throw new ProfitMandiBusinessException("", "", "Could not connect to host");
285
			}
285
			}
286
			JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("response");
286
			JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("response");
287
			JSONArray docs = solrResponseJSONObj.getJSONArray("docs");
287
			JSONArray docs = solrResponseJSONObj.getJSONArray("docs");
Line 434... Line 434...
434
			params.put("fl", "*, [child parentFilter=id:catalog*]");
434
			params.put("fl", "*, [child parentFilter=id:catalog*]");
435
			params.put("sort", "rank_i asc, create_s desc");
435
			params.put("sort", "rank_i asc, create_s desc");
436
			params.put("wt", "json");
436
			params.put("wt", "json");
437
			String response = null;
437
			String response = null;
438
			try {
438
			try {
439
				response = rc.get(SchemeType.HTTP, "dtr", 8984, "solr/demo/select", params);
439
				response = rc.get(SchemeType.HTTP, "50.116.10.120", 8984, "solr/demo/select", params);
440
			} catch (HttpHostConnectException e) {
440
			} catch (HttpHostConnectException e) {
441
				throw new ProfitMandiBusinessException("", "", "Could not connect to host");
441
				throw new ProfitMandiBusinessException("", "", "Could not connect to host");
442
			}
442
			}
443
			JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("response");
443
			JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("response");
444
			JSONArray docs = solrResponseJSONObj.getJSONArray("docs");
444
			JSONArray docs = solrResponseJSONObj.getJSONArray("docs");
Line 478... Line 478...
478
		params.put("wt", "json");
478
		params.put("wt", "json");
479
		params.put("rows", "50");
479
		params.put("rows", "50");
480
		params.put("fl", "subCategoryId_i");
480
		params.put("fl", "subCategoryId_i");
481
		String response = null;
481
		String response = null;
482
		try {
482
		try {
483
			response = rc.get(SchemeType.HTTP, "dtr", 8984, "solr/demo/select", params);
483
			response = rc.get(SchemeType.HTTP, "50.116.10.120", 8984, "solr/demo/select", params);
484
		} catch (HttpHostConnectException e) {
484
		} catch (HttpHostConnectException e) {
485
			throw new ProfitMandiBusinessException("", "", "Could not connect to host");
485
			throw new ProfitMandiBusinessException("", "", "Could not connect to host");
486
		}
486
		}
487
		JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("grouped");
487
		JSONObject solrResponseJSONObj = new JSONObject(response).getJSONObject("grouped");
488
		JSONArray groups = solrResponseJSONObj.getJSONObject("subCategoryId_i").getJSONArray("groups");
488
		JSONArray groups = solrResponseJSONObj.getJSONObject("subCategoryId_i").getJSONArray("groups");