Class Main
java.lang.Object
org.nuxeo.ecm.webengine.model.impl.AbstractResource<ResourceTypeImpl>
org.nuxeo.ecm.webengine.model.impl.DefaultObject
org.nuxeo.ecm.webengine.model.impl.ModuleRoot
org.nuxeo.ecm.restapi.opensearch1.Main
- All Implemented Interfaces:
ModuleResource
,Resource
,Adaptable
Exposes a limited set of Read Only Elasticsearch REST API.
- Since:
- 7.3
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
doSearchWithPayload
(String indices, String rawQuery, String payload) protected String
doSearchWithPayload
(String indices, String types, String rawQuery, String payload) Deprecated, for removal: This API element is subject to removal in a future version.getDocument
(String indices, String documentId, jakarta.ws.rs.core.UriInfo uriInf) getDocument
(String indices, String types, String documentId, jakarta.ws.rs.core.UriInfo uriInf) 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, usegetDocument(String, String, UriInfo)
insteadprotected String
@NotNull NuxeoPrincipal
protected String
getWithRestClient
(String endpoint) protected String
getWithRestClient
(String endpoint, String payload) searchWithPayload
(jakarta.ws.rs.core.UriInfo uriInf, jakarta.ws.rs.core.MultivaluedMap<String, String> formParams) searchWithPayload
(String indices, jakarta.ws.rs.core.UriInfo uriInf, jakarta.ws.rs.core.MultivaluedMap<String, String> formParams) searchWithPayload
(String indices, String types, jakarta.ws.rs.core.UriInfo uriInf, jakarta.ws.rs.core.MultivaluedMap<String, String> formParams) 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, usesearchWithPayload(String, UriInfo, MultivaluedMap)
insteadsearchWithPost
(jakarta.ws.rs.core.UriInfo uriInf, String payload) searchWithPost
(String indices, jakarta.ws.rs.core.UriInfo uriInf, String payload) searchWithPost
(String indices, String types, jakarta.ws.rs.core.UriInfo uriInf, String payload) 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, usesearchWithPost(String, UriInfo, String)
insteadsearchWithUri
(String indices, jakarta.ws.rs.core.UriInfo uriInf) searchWithUri
(String indices, String types, jakarta.ws.rs.core.UriInfo uriInf) 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, usesearchWithUri(String, UriInfo)
insteadMethods inherited from class org.nuxeo.ecm.webengine.model.impl.ModuleRoot
getLink, getSkinResource, handleError, setContext
Methods inherited from class org.nuxeo.ecm.webengine.model.impl.DefaultObject
disptachAdapter, isAdapter
Methods inherited from class org.nuxeo.ecm.webengine.model.impl.AbstractResource
checkGuard, dispose, getActiveAdapter, getAdapter, getContext, getFacets, getLinks, getModule, getName, getNext, getNextSegment, getPath, getPrevious, getTemplate, getTrailingPath, getType, getURL, getView, hasFacet, initialize, initialize, isInstanceOf, isRoot, newAdapter, newObject, redirect, setNext, setPrevious, setRoot, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.nuxeo.runtime.model.Adaptable
getAdapter
Methods inherited from interface org.nuxeo.ecm.webengine.model.Resource
checkGuard, dispose, getActiveAdapter, getContext, getFacets, getLinks, getModule, getName, getNext, getNextSegment, getPath, getPrevious, getTemplate, getTrailingPath, getType, getURL, getView, hasFacet, initialize, isAdapter, isInstanceOf, isRoot, newAdapter, newObject, redirect, setNext, setPrevious, setRoot
-
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.JSONExceptionDeprecated, for removal: This API element is subject to removal in a future version.since 11.4, types have been removed since Elasticsearch 7.x, usesearchWithPayload(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, usesearchWithPost(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, usedoSearchWithPayload(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, usesearchWithUri(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, usegetDocument(String, String, UriInfo)
instead- Throws:
org.json.JSONException
-
getElasticsearchBaseUrl
-
getPrincipal
-
getWithRestClient
-
getWithRestClient
-
doSearchWithPayload(String, String, String)
instead