Subversion Repositories SmartDukaan

Rev

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

Rev 27324 Rev 27325
Line 28... Line 28...
28
	private RestClient restClient;
28
	private RestClient restClient;
29
	public String getContent(String queryTerm) throws Exception {
29
	public String getContent(String queryTerm) throws Exception {
30
		Map<String, String> params = new HashMap<>();
30
		Map<String, String> params = new HashMap<>();
31
		List<String> mandatoryQ = new ArrayList<>();
31
		List<String> mandatoryQ = new ArrayList<>();
32
		if (queryTerm != null && !queryTerm.equals("null")) {
32
		if (queryTerm != null && !queryTerm.equals("null")) {
33
			mandatoryQ.add(String.format("+(%s)", queryTerm));
33
			mandatoryQ.add(String.format("+(%s)", "*"+queryTerm + "*"));
34
		} else {
34
		} else {
35
			queryTerm = null;
35
			queryTerm = null;
36
		}
36
		}
37
		params.put("q", StringUtils.join("*" + mandatoryQ + "*", " "));
37
		params.put("q", StringUtils.join(mandatoryQ, " "));
38
		params.put("fl", "*");
38
		params.put("fl", "*");
39
		if (queryTerm == null) {
39
		if (queryTerm == null) {
40
			params.put("sort", "create_s desc");
40
			params.put("sort", "create_s desc");
41
		}
41
		}
42
		params.put("start", String.valueOf(0));
42
		params.put("start", String.valueOf(0));