Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] can't modify response format in SQL plugin (JDBC to json) #155

Closed
archipelweb opened this issue May 26, 2023 · 7 comments
Closed
Labels
bug Something isn't working enhancement New feature or request

Comments

@archipelweb
Copy link
Contributor

Is your feature request related to a problem?

In a query in SQL, we wan't to get the internal document id (key : _id) and his index (key : _index)
but the default format response (JDBC) don't return this keys
We get schema and values

In the official documentation i found this :
https://opensearch.org/docs/latest/search-plugins/sql/response-formats
I want to use the json format.

In SQL plugin, we can't modify the default response format
If we try to put the format in parameters we have this message :

OpenSearch\\Common\\Exceptions\\UnexpectedValueException: \"format\" is not a valid parameter. Allowed parameters are \"error_trace\", \"filter_path\", \"human\", \"opaqueId\", \"pretty\", \"source\" in /vendor/opensearch-project/opensearch-php/src/OpenSearch/Endpoints/AbstractEndpoint.php on line 250

What solution would you like?

Add the support of this parameter format in allowable parameters for SQL Plugin

In src/OpenSearch/Endpoints/Sql/Query.php

Change the method

 public function getParamWhitelist(): array
    {
        return [];
    }

to :

 public function getParamWhitelist(): array
    {
        return [
            'format'
        ];
    }

I tested this solution by physically changing this file in the vendor directory
it's good for me

What alternatives have you considered?

If this issue don't succeded, we can made a fork but this solution is overkill :D

Do you have any additional context?

I hope I have been as clear as possible

@archipelweb archipelweb added enhancement New feature or request untriaged labels May 26, 2023
@shyim
Copy link
Collaborator

shyim commented May 26, 2023

Hey,

feel free to make a PR :)

@archipelweb
Copy link
Contributor Author

Hi,
Do you have a date for the next release?

@dblock
Copy link
Member

dblock commented Sep 15, 2023

Can we close this with #161?

@archipelweb Feel free to open an issue like "Please release v.xyz." and everyone should add some +1s, we'll be happy to do a release quickly as needed.

@wbeckler wbeckler added the bug Something isn't working label Oct 3, 2023
@goran-popovic
Copy link

goran-popovic commented Apr 18, 2024

Hi, can this be released? Regarding my particular use case, it's interfering with Laravel Scout since it expects "hits" to be present in the results, and the "hits" are present when using the JSON format only.

I believe this can be closed with #161.

@dblock Should I create an issue that says "Please release v2.2.1"? Should it be a proposal? I don't see that being done before, so I'm not sure about the format of the issue.

@dblock
Copy link
Member

dblock commented Apr 18, 2024

@goran-popovic Yes, please create the issue, @shyim I can try to make a release (or you can if you have time), any objections?

@dblock
Copy link
Member

dblock commented Apr 18, 2024

Closing via #161.

@goran-popovic
Copy link

@dblock here it is #181. Please address it when able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants