Basically, what I am trying to do is make a request like this:
http://localhost:8085/api/candidates/searchWithFacet?q=helmut&page=0&size=20&fq=skills%3A%22Keine%20Angabe%22&
but Spring MVC is throwing this error:
java.net.URISyntaxException: Illegal character in query at index 51: /api/candidates/searchWithFacet?q=helmut&fq=skills:"Keine Angabe"?page=0&size=20
I don't understand why it is stating that I have an illegal character as I am encoding it. I have also tried encoding the whole URL, not just the last part of it like this:
http://localhost:8085/%2Fapi%2Fcandidates%2Fsearch%3Fq%3Dhelmut%26page%3D0%26size%3D20
The error I am receiving here is 400 - Bad Request.
My two involved Controller functions are:
@Timed
@RequestMapping(value = "/candidates/search", method = RequestMethod.GET, produces = {
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<CandidateListDTO> searchCandidatesWithFaceting(@RequestParam(name = "q") String query,
Pageable page) throws SolrServerException, URISyntaxException {
...
@Timed
@RequestMapping(value = "/candidates/searchWithFacet", method = RequestMethod.GET, produces = {
MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity<CandidateListDTO> getCandidatesWithFacet(@RequestParam(name = "q") String query,
@RequestParam(name = "fq") String facetQuery, Pageable page)
throws SolrServerException, URISyntaxException {
Any help is appreciated, thanks in advance! :-)