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

Search request response format should not be coupled with query format #11718

Open
jainankitk opened this issue Jan 3, 2024 · 2 comments
Open
Labels
enhancement Enhancement or improvement to existing feature or request Search:Performance Search Search query, autocomplete ...etc

Comments

@jainankitk
Copy link
Collaborator

Is your feature request related to a problem? Please describe

While working on query rewriting, I noticed that the query response format in opensearch is tightly coupled with query format. It should just be data dependent allowing translation into more efficient queries without impacting the response format. For example:

The response for

"_source": false,
  "stored_fields": "_none_",
  "docvalue_fields": [
    {
      "field": "_id"
    }
  ],

is

{"took":8,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":1,"relation":"eq"},"max_score":null,"hits":[{"_index":"es-test","_type":"_doc","_score":null,"fields":{"_id":["123456789"]}}]}}

whereas for below query:

"_source": false,
<no stored fields or docvalue_fields specification>

it is:

{"took":8,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":1,"relation":"eq"},"max_score":null,"hits":[{"_index":"es-test","_type":"_doc","_score":null,"_id":"123456789"}]}}

While the difference in above seems minimal, this can easily break the end client.

Describe the solution you'd like

We should reevaluate all the query response types and ensure they are data oriented instead of being coupled with query format.

Related component

Search

Describe alternatives you've considered

No response

Additional context

No response

@jainankitk jainankitk added enhancement Enhancement or improvement to existing feature or request untriaged labels Jan 3, 2024
@github-actions github-actions bot added the Search Search query, autocomplete ...etc label Jan 3, 2024
@msfroh
Copy link
Collaborator

msfroh commented Jan 3, 2024

@jainankitk -- Do you plan to work on this yourself? Can we assign it to you?

@msfroh msfroh removed the untriaged label Jan 3, 2024
@jainankitk
Copy link
Collaborator Author

@msfroh - Yes I should own it, so you can assign to me. Just wanted to get feedback on the idea, and which version (probably major version) should we target

@jainankitk jainankitk changed the title Search request response format should not be couple with query format Search request response format should not be coupled with query format Jan 3, 2024
@jainankitk jainankitk moved this from Todo to Now (This Quarter) in Performance Roadmap May 28, 2024
@jainankitk jainankitk moved this from Now (This Quarter) to Todo in Performance Roadmap May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Search:Performance Search Search query, autocomplete ...etc
Projects
Status: Todo
Status: 🆕 New
Development

No branches or pull requests

2 participants