Hi,
i wanted elasticsearch functionality exposed as restfull webservice. I
tried the restful example from below branch.
My controller class is below
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
/**
- @author vnarayanaswamy
*/
@Controller
@RequestMapping("/api")
public class SearchRestApi {
final Logger logger = LoggerFactory.getLogger(SearchRestApi.class);
IncidentService incidentService;
@RequestMapping(value = "/find/{id}", method = RequestMethod.GET)
public @ResponseBody Incident findByIrId(@PathVariable long id) throws
Exception {
return incidentService.findByIrId(id);
}
//@Transactional(propagation = Propagation.NOT_SUPPORTED)
@RequestMapping(value = "/search", method = RequestMethod.GET)
public @ResponseBody String search1(@RequestParam Integer from,
@RequestParam Integer size) throws Exception {
incidentService = new IncidentService();
return incidentService.search("new", from, size);
}
I tried to debug the controller class but its not invoking the search1
method.
I get below error when i tried to invoke using url -
https://localhost:8443/api/search
Status
0 NO RESPONSE Loading time: 506
Request headers
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/39.0.2171.71 Safari/537.36
Content-Type: text/plain; charset=utf-8
Accept: /
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: JSESSIONID=246ED813F970B1BAB3AFBED0752E9ACE
Thanks in advance,
Vijaya
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1005c8e3-3886-4371-b7ca-685a06eb5b48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.