[FEATURE]Adding an HTTP GET endpoint for OpenSearch's PPL
Is your feature request related to a problem? Adding an HTTP GET endpoint for OpenSearch's PPL is significant for several reasons, particularly when considering the context of providing a query as a URL parameter.
This approach offers a range of benefits for both developers and users:
Ease of Integration and Accessibility: GET requests are the fundamental method used in web browsers to retrieve data. By enabling PPL queries through GET requests, OpenSearch makes it easier for various applications and services to integrate with its search capabilities. Developers can simply construct a URL with the required query and fetch results without the need for more complex setups.
Direct Linking to Specific Queries: A GET endpoint allows users to create direct links to specific queries. This feature is incredibly useful for bookmarking, sharing, or embedding specific searches in documents or web pages. It also facilitates the creation of hyperlinks that, when clicked, execute a predefined search, thereby enhancing user experience and efficiency (Including Vega data url)
Simplifying Client-Side Implementations: Since the query is included in the URL, client-side applications (like web browsers or simple HTTP clients) can easily fetch data without the need for additional libraries or complex JSON payloads that are typical with POST requests.
Statelessness and Cacheability: GET requests are stateless and can be easily cached. This means repeated requests for the same query can be served faster, reducing the load on the server and improving response times for the user.
Facilitating Self-Contained Queries: Encapsulating the entire query within a URL makes each request self-contained. This approach is useful for logging, auditing, and debugging purposes as each URL contains all the information necessary to understand and reproduce the query.
Web Standards and Compatibility: GET requests are a standard part of the HTTP protocol and are supported by all web technologies. This universal compatibility ensures that the PPL queries can be executed from any platform or device capable of making HTTP requests.
Examples of Similar Use Cases in Other Systems:
Elasticsearch: Similar to OpenSearch, Elasticsearch allows users to submit search queries directly in the URL using a GET request, making it easy to share and replicate searches.
Google's Search Parameters: Google's search engine allows users to perform searches by passing query parameters in the URL, demonstrating how powerful and user-friendly URL-based queries can be.
APIs for Data Retrieval: Many RESTful APIs use GET requests with query parameters for data retrieval, such as the Twitter API for fetching tweets based on certain search criteria.
What solution would you like? Add GET endpoint support to match the POST endpoint
+1. Direct Linking to Specific Queries is really usefull.
For your reference, here is the old issue that deprecate GET endpoint for security concern: https://github.com/opendistro-for-elasticsearch/sql/issues/413. Please review if the proposal has similar issue or not.
@dai-chen I agree that some cases may better be using the POST request for security reasons - but nevertheless its still worthwhile for having the GET API so that queries which have no security risks be used for the above utilities
closing this due to the initiative for moving PPL into core