Subversion Repositories SmartDukaan

Rev

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

Rev 24995 Rev 35435
Line 47... Line 47...
47
	private int mobile_records, tablet_records;
47
	private int mobile_records, tablet_records;
48
	private JsonObject result_json;
48
	private JsonObject result_json;
49
 
49
 
50
	@RequestMapping(value = ProfitMandiConstants.URL_SOLR_SEARCH, method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
50
	@RequestMapping(value = ProfitMandiConstants.URL_SOLR_SEARCH, method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
51
	@ApiImplicitParams({
51
	@ApiImplicitParams({
52
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", 
52
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
53
				required = true, dataType = "string", paramType = "header")
53
				required = true, dataType = "string", paramType = "header")
54
	})
54
	})
55
	@ApiOperation(value = "Search Results")
55
	@ApiOperation(value = "Search Results")
-
 
56
	@org.springframework.transaction.annotation.Transactional(readOnly = true)
56
	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){
57
		logger.info("search_text : "+search_text+" offset : "+offset);
58
		logger.info("search_text : "+search_text+" offset : "+offset);
58
		String jsonString = null;
59
		String jsonString = null;
59
		try {
60
		try {
60
			jsonString = solrService.getSearchResults(search_text.trim(), offset);
61
			jsonString = solrService.getSearchResults(search_text.trim(), offset);
Line 73... Line 74...
73
	}
74
	}
74
 
75
 
75
 
76
 
76
	@RequestMapping(value = ProfitMandiConstants.URL_SOLR_SUGGESTION, method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
77
	@RequestMapping(value = ProfitMandiConstants.URL_SOLR_SUGGESTION, method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
77
	@ApiImplicitParams({
78
	@ApiImplicitParams({
78
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", 
79
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
79
				required = true, dataType = "string", paramType = "header")
80
				required = true, dataType = "string", paramType = "header")
80
	})
81
	})
81
	@ApiOperation(value = "Auto Suggest")
82
	@ApiOperation(value = "Auto Suggest")
-
 
83
	@org.springframework.transaction.annotation.Transactional(readOnly = true)
82
	public ResponseEntity<?> getSuggestions(@RequestParam("search_text") String searchText){
84
	public ResponseEntity<?> getSuggestions(@RequestParam("search_text") String searchText){
83
		logger.info("Suggestion text : "+searchText);
85
		logger.info("Suggestion text : "+searchText);
84
		String jsonString;
86
		String jsonString;
85
		try {
87
		try {
86
			jsonString = solrService.getSuggestions(searchText.trim());
88
			jsonString = solrService.getSuggestions(searchText.trim());