| Line 77... |
Line 77... |
| 77 |
@ApiImplicitParams({
|
77 |
@ApiImplicitParams({
|
| 78 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
78 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
| 79 |
required = true, dataType = "string", paramType = "header")
|
79 |
required = true, dataType = "string", paramType = "header")
|
| 80 |
})
|
80 |
})
|
| 81 |
@ApiOperation(value = "Auto Suggest")
|
81 |
@ApiOperation(value = "Auto Suggest")
|
| 82 |
public ResponseEntity<?> getSuggestions(@RequestParam("search_text") String search_text){
|
82 |
public ResponseEntity<?> getSuggestions(@RequestParam("search_text") String searchText){
|
| 83 |
logger.info("Suggestion text : "+search_text);
|
83 |
logger.info("Suggestion text : "+searchText);
|
| 84 |
String jsonString;
|
84 |
String jsonString;
|
| 85 |
try {
|
85 |
try {
|
| 86 |
jsonString = solrService.getSuggestions(search_text.trim());
|
86 |
jsonString = solrService.getSuggestions(searchText.trim());
|
| 87 |
} catch (URISyntaxException | IOException e) {
|
87 |
} catch (URISyntaxException | IOException e) {
|
| 88 |
logger.error("Error while getting suggestions from solr",e);
|
88 |
logger.error("Error while getting suggestions from solr",e);
|
| 89 |
return responseSender.internalServerError(e);
|
89 |
return responseSender.internalServerError(e);
|
| 90 |
}
|
90 |
}
|
| 91 |
result_json = Json.parse(jsonString).asObject().get("grouped").asObject();
|
91 |
result_json = Json.parse(jsonString).asObject().get("grouped").asObject();
|