| Line 29... |
Line 29... |
| 29 |
import io.swagger.annotations.ApiImplicitParam;
|
29 |
import io.swagger.annotations.ApiImplicitParam;
|
| 30 |
import io.swagger.annotations.ApiImplicitParams;
|
30 |
import io.swagger.annotations.ApiImplicitParams;
|
| 31 |
import io.swagger.annotations.ApiOperation;
|
31 |
import io.swagger.annotations.ApiOperation;
|
| 32 |
|
32 |
|
| 33 |
@Controller
|
33 |
@Controller
|
| - |
|
34 |
@org.springframework.transaction.annotation.Transactional(rollbackFor = Throwable.class)
|
| 34 |
public class SolrSearchController {
|
35 |
public class SolrSearchController {
|
| 35 |
|
36 |
|
| 36 |
private static final Logger logger=LogManager.getLogger(SolrSearchController.class);
|
37 |
private static final Logger logger=LogManager.getLogger(SolrSearchController.class);
|
| 37 |
|
38 |
|
| 38 |
@Autowired
|
39 |
@Autowired
|
| Line 51... |
Line 52... |
| 51 |
@ApiImplicitParams({
|
52 |
@ApiImplicitParams({
|
| 52 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
53 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
| 53 |
required = true, dataType = "string", paramType = "header")
|
54 |
required = true, dataType = "string", paramType = "header")
|
| 54 |
})
|
55 |
})
|
| 55 |
@ApiOperation(value = "Search Results")
|
56 |
@ApiOperation(value = "Search Results")
|
| 56 |
@org.springframework.transaction.annotation.Transactional(readOnly = true)
|
- |
|
| 57 |
public ResponseEntity<?> getSearchResults(@RequestParam("search_text") String search_text, @RequestParam("offset") int offset){
|
57 |
public ResponseEntity<?> getSearchResults(@RequestParam("search_text") String search_text, @RequestParam("offset") int offset){
|
| 58 |
logger.info("search_text : "+search_text+" offset : "+offset);
|
58 |
logger.info("search_text : "+search_text+" offset : "+offset);
|
| 59 |
String jsonString = null;
|
59 |
String jsonString = null;
|
| 60 |
try {
|
60 |
try {
|
| 61 |
jsonString = solrService.getSearchResults(search_text.trim(), offset);
|
61 |
jsonString = solrService.getSearchResults(search_text.trim(), offset);
|
| Line 78... |
Line 78... |
| 78 |
@ApiImplicitParams({
|
78 |
@ApiImplicitParams({
|
| 79 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
79 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
| 80 |
required = true, dataType = "string", paramType = "header")
|
80 |
required = true, dataType = "string", paramType = "header")
|
| 81 |
})
|
81 |
})
|
| 82 |
@ApiOperation(value = "Auto Suggest")
|
82 |
@ApiOperation(value = "Auto Suggest")
|
| 83 |
@org.springframework.transaction.annotation.Transactional(readOnly = true)
|
- |
|
| 84 |
public ResponseEntity<?> getSuggestions(@RequestParam("search_text") String searchText){
|
83 |
public ResponseEntity<?> getSuggestions(@RequestParam("search_text") String searchText){
|
| 85 |
logger.info("Suggestion text : "+searchText);
|
84 |
logger.info("Suggestion text : "+searchText);
|
| 86 |
String jsonString;
|
85 |
String jsonString;
|
| 87 |
try {
|
86 |
try {
|
| 88 |
jsonString = solrService.getSuggestions(searchText.trim());
|
87 |
jsonString = solrService.getSuggestions(searchText.trim());
|