Class Main

All Implemented Interfaces:
ModuleResource, Resource, Adaptable

@Path("/es") public class Main extends ModuleRoot
Exposes a limited set of Read Only Elasticsearch REST API.
Since:
7.3
  • Constructor Details

    • Main

      public Main()
  • Method Details

    • searchWithPayload

      @GET @Path("_search") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public String searchWithPayload(@Context jakarta.ws.rs.core.UriInfo uriInf, jakarta.ws.rs.core.MultivaluedMap<String,String> formParams) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • searchWithPost

      @POST @Path("_search") @Consumes("application/json") @Produces("application/json") public String searchWithPost(@Context jakarta.ws.rs.core.UriInfo uriInf, String payload) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • searchWithPayload

      @GET @Path("{indices}/_search") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public String searchWithPayload(@PathParam("indices") String indices, @Context jakarta.ws.rs.core.UriInfo uriInf, jakarta.ws.rs.core.MultivaluedMap<String,String> formParams) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • searchWithPost

      @POST @Path("{indices}/_search") @Consumes("application/json") @Produces("application/json") public String searchWithPost(@PathParam("indices") String indices, @Context jakarta.ws.rs.core.UriInfo uriInf, String payload) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • searchWithPayload

      @GET @Path("{indices}/{types}/_search") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") @Deprecated(since="11.4", forRemoval=true) public String searchWithPayload(@PathParam("indices") String indices, @PathParam("types") String types, @Context jakarta.ws.rs.core.UriInfo uriInf, jakarta.ws.rs.core.MultivaluedMap<String,String> formParams) throws IOException, org.json.JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 11.4, types have been removed since Elasticsearch 7.x, use searchWithPayload(String, UriInfo, MultivaluedMap) instead
      Throws:
      IOException
      org.json.JSONException
    • searchWithPost

      @POST @Path("{indices}/{types}/_search") @Consumes("application/json") @Produces("application/json") @Deprecated(since="11.4", forRemoval=true) public String searchWithPost(@PathParam("indices") String indices, @PathParam("types") String types, @Context jakarta.ws.rs.core.UriInfo uriInf, String payload) throws IOException, org.json.JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 11.4, types have been removed since Elasticsearch 7.x, use searchWithPost(String, UriInfo, String) instead
      Throws:
      IOException
      org.json.JSONException
    • doSearchWithPayload

      @Deprecated(since="11.4", forRemoval=true) protected String doSearchWithPayload(String indices, String types, String rawQuery, String payload) throws org.json.JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 11.4, types have been removed since Elasticsearch 7.x, use doSearchWithPayload(String, String, String) instead
      Throws:
      org.json.JSONException
    • doSearchWithPayload

      protected String doSearchWithPayload(String indices, String rawQuery, String payload) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • searchWithUri

      @GET @Path("{indices}/_search") @Produces("application/json") public String searchWithUri(@PathParam("indices") String indices, @Context jakarta.ws.rs.core.UriInfo uriInf) throws org.json.JSONException
      Throws:
      org.json.JSONException
      Since:
      11.4
    • searchWithUri

      @GET @Path("{indices}/{types}/_search") @Produces("application/json") @Deprecated(since="11.4", forRemoval=true) public String searchWithUri(@PathParam("indices") String indices, @PathParam("types") String types, @Context jakarta.ws.rs.core.UriInfo uriInf) throws org.json.JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 11.4, types have been removed since Elasticsearch 7.x, use searchWithUri(String, UriInfo) instead
      Throws:
      org.json.JSONException
    • getDocument

      @GET @Path("{indices}/{documentId: [a-zA-Z0-9\\-]+}") @Produces("application/json") public String getDocument(@PathParam("indices") String indices, @PathParam("documentId") String documentId, @Context jakarta.ws.rs.core.UriInfo uriInf) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • getDocument

      @GET @Path("{indices}/{types}/{documentId: [a-zA-Z0-9\\-]+}") @Produces("application/json") @Deprecated(since="11.4", forRemoval=true) public String getDocument(@PathParam("indices") String indices, @PathParam("types") String types, @PathParam("documentId") String documentId, @Context jakarta.ws.rs.core.UriInfo uriInf) throws org.json.JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 11.4, types have been removed since Elasticsearch 7.x, use getDocument(String, String, UriInfo) instead
      Throws:
      org.json.JSONException
    • getElasticsearchBaseUrl

      protected String getElasticsearchBaseUrl()
    • getPrincipal

      @NotNull public @NotNull NuxeoPrincipal getPrincipal()
    • getWithRestClient

      protected String getWithRestClient(String endpoint)
    • getWithRestClient

      protected String getWithRestClient(String endpoint, String payload)