| 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");
|