Subversion Repositories SmartDukaan

Rev

Rev 37144 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37144 Rev 37250
Line 30... Line 30...
30
    @Autowired
30
    @Autowired
31
    private RestClient restClient;
31
    private RestClient restClient;
32
 
32
 
33
    public JSONArray selectDocs(Map<String, String> params, int fofoId) throws ProfitMandiBusinessException {
33
    public JSONArray selectDocs(Map<String, String> params, int fofoId) throws ProfitMandiBusinessException {
34
        brandsService.applyRestrictedSolrExclusion(params, fofoId);
34
        brandsService.applyRestrictedSolrExclusion(params, fofoId);
-
 
35
        return selectDocsRaw(params);
-
 
36
    }
-
 
37
 
-
 
38
    /**
-
 
39
     * Pure HTTP query with no DB access — safe to call off the request thread. The caller
-
 
40
     * is responsible for having applied the partner's brand exclusion to params already.
-
 
41
     */
-
 
42
    public JSONArray selectDocsRaw(Map<String, String> params) throws ProfitMandiBusinessException {
35
        String response;
43
        String response;
36
        try {
44
        try {
37
            response = restClient.get(SchemeType.HTTP, solrUrl, 8984, "solr/demo/select", params);
45
            response = restClient.get(SchemeType.HTTP, solrUrl, 8984, "solr/demo/select", params);
38
        } catch (HttpHostConnectException e) {
46
        } catch (HttpHostConnectException e) {
39
            throw new ProfitMandiBusinessException("", "", "Could not connect to host");
47
            throw new ProfitMandiBusinessException("", "", "Could not connect to host");