import javax.servlet.http.HttpServletResponse;
import java.security.cert.X509Certificate;
-// import javax.servlet.http.HttpServletRequest;
-
@Component
@EnableWebSecurity
@RestController
-@RequestMapping("/services/search-db-service/v1")
+@RequestMapping("/services/search-data-service/v1/search")
public class SearchServiceApi {
/**
method = RequestMethod.DELETE,
consumes = {"application/json"},
produces = {"application/json"})
- public ResponseEntity<String> processDeleteIndex(String requestBody,
- HttpServletRequest request,
- @RequestHeader HttpHeaders headers,
- @PathVariable ("index") String index) {
+ public ResponseEntity<String> processDeleteIndex(HttpServletRequest request,
+ @RequestHeader HttpHeaders headers,
+ @PathVariable ("index") String index) {
// Forward the request to our index API to delete the index.
IndexApi indexApi = new IndexApi(this);
@RequestMapping(value = "/indexes/{index}/documents",
method = RequestMethod.POST,
consumes = {"application/json"})
- public ResponseEntity<String> processCreateDocWithoutId(String requestBody,
+ public ResponseEntity<String> processCreateDocWithoutId(@RequestBody String requestBody,
HttpServletRequest request,
HttpServletResponse httpResponse,
@RequestHeader HttpHeaders headers,
@RequestMapping(value = "/indexes/{index}/documents/{id}",
method = RequestMethod.PUT,
consumes = {"application/json"})
- public ResponseEntity<String> processUpsertDoc(String requestBody,
+ public ResponseEntity<String> processUpsertDoc(@RequestBody String requestBody,
HttpServletRequest request,
HttpServletResponse httpResponse,
@RequestHeader HttpHeaders headers,
}
@RequestMapping(value = "/indexes/{index}/documents/{id}",
- method = RequestMethod.GET)
- public ResponseEntity<String> processGetDocument(String requestBody,
- HttpServletRequest request,
+ method = RequestMethod.GET,
+ consumes = {"application/json"})
+ public ResponseEntity<String> processGetDocument(HttpServletRequest request,
HttpServletResponse httpResponse,
@RequestHeader HttpHeaders headers,
@PathVariable ("index") String index,
// Forward the request to our document API to retrieve the document.
DocumentApi documentApi = new DocumentApi(this);
- return documentApi.processGet(requestBody, request, headers, httpResponse,
+ return documentApi.processGet("", request, headers, httpResponse,
index, id, documentStore);
}
@RequestMapping(value = "/indexes/{index}/documents/{id}",
method = RequestMethod.DELETE,
consumes = {"application/json"})
- public ResponseEntity<String> processDeleteDoc(String requestBody,
- HttpServletRequest request,
- HttpServletResponse httpResponse,
- @RequestHeader HttpHeaders headers,
- @PathVariable ("index") String index,
- @PathVariable ("id") String id) {
+ public ResponseEntity<String> processDeleteDoc(HttpServletRequest request,
+ HttpServletResponse httpResponse,
+ @RequestHeader HttpHeaders headers,
+ @PathVariable ("index") String index,
+ @PathVariable ("id") String id) {
// Forward the request to our document API to delete the document.
DocumentApi documentApi = new DocumentApi(this);
- return documentApi.processDelete(requestBody, request, headers, httpResponse,
+ return documentApi.processDelete("", request, headers, httpResponse,
index, id, documentStore);
}
@RequestMapping(value = "/indexes/{index}/query/{queryText}",
method = RequestMethod.GET,
consumes = {"application/json"})
- public ResponseEntity<String> processInlineQuery(String requestBody,
- HttpServletRequest request,
- @RequestHeader HttpHeaders headers,
- @PathVariable ("index") String index,
- @PathVariable ("queryText") String queryText) {
+ public ResponseEntity<String> processInlineQuery(HttpServletRequest request,
+ @RequestHeader HttpHeaders headers,
+ @PathVariable ("index") String index,
+ @PathVariable ("queryText") String queryText) {
// Forward the request to our document API to delete the document.
DocumentApi documentApi = new DocumentApi(this);
- return documentApi.processSearchWithGet(requestBody, request, headers,
+ return documentApi.processSearchWithGet("", request, headers,
index, queryText, documentStore);
}
@RequestMapping(value = "/indexes/{index}/query",
method = RequestMethod.GET,
consumes = {"application/json"})
- public ResponseEntity<String> processQueryWithGet(String requestBody,
- HttpServletRequest request,
- @RequestHeader HttpHeaders headers,
- @PathVariable ("index") String index) {
+ public ResponseEntity<String> processQueryWithGet(@RequestBody String requestBody,
+ HttpServletRequest request,
+ @RequestHeader HttpHeaders headers,
+ @PathVariable ("index") String index) {
// Forward the request to our document API to delete the document.
DocumentApi documentApi = new DocumentApi(this);
@RequestMapping(value = "/indexes/{index}/query",
method = RequestMethod.POST,
consumes = {"application/json"})
- public ResponseEntity<String> processQuery(String requestBody,
+ public ResponseEntity<String> processQuery(@RequestBody String requestBody,
HttpServletRequest request,
@RequestHeader HttpHeaders headers,
@PathVariable ("index") String index) {
@RequestMapping(value = "/indexes/{index}/suggest",
method = RequestMethod.POST,
consumes = {"application/json"})
- public ResponseEntity<String> processSuggestQuery(String requestBody, HttpServletRequest request,
+ public ResponseEntity<String> processSuggestQuery(@RequestBody String requestBody, HttpServletRequest request,
@RequestHeader HttpHeaders headers, @PathVariable("index") String index) {
// Forward the request to our document API to query suggestions in the
// document.
@RequestMapping(value = "/indexes/dynamic/{index}",
method = RequestMethod.PUT,
consumes = {"application/json"})
- public ResponseEntity<String> processCreateDynamicIndex(String requestBody,
+ public ResponseEntity<String> processCreateDynamicIndex(@RequestBody String requestBody,
HttpServletRequest request,
@RequestHeader HttpHeaders headers,
@PathVariable ("index") String index) {
@RequestMapping(value = "/bulk",
method = RequestMethod.POST,
consumes = {"application/json"})
- public ResponseEntity<String> processBulkRequest(String requestBody,
+ public ResponseEntity<String> processBulkRequest(@RequestBody String requestBody,
HttpServletRequest request,
@RequestHeader HttpHeaders headers) {