Skip to content

[FEATURE] Support range queries #7050

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

Closed
hughbe opened this issue Nov 27, 2022 · 15 comments · Fixed by #7311
Closed

[FEATURE] Support range queries #7050

hughbe opened this issue Nov 27, 2022 · 15 comments · Fixed by #7311
Labels
8.x Relates to a 8.x client version
Milestone

Comments

@hughbe
Copy link

hughbe commented Nov 27, 2022

I’m trying to migrate a library from 7.x to 8.x. However, I cannot find support the date_range query in the new version of the library.

Will support for this query be added?

@hughbe hughbe added the Feature label Nov 27, 2022
@lmauri
Copy link

lmauri commented Nov 28, 2022

Having the same problem, just switched back to the 8.0.0rc2 where the data range query is available and working.

@perf2711
Copy link

perf2711 commented Dec 3, 2022

Same here - cannot find the range query. Was it removed after 8.0.0rc2?

@stevejgordon
Copy link
Contributor

This was removed after RC2 as we found some edge case bugs with the generated query that meant it wasn't fit for the final release. We documented the supported queries for the 8.0.0 release. We will (re)introduce this (and other) query types in future client releases. Thanks for raising your need for this type, as it helps prioritise that work.

@stevejgordon stevejgordon added the 8.x Relates to a 8.x client version label Dec 13, 2022
@stevejgordon stevejgordon changed the title [8.x] no support for date_range [FEATURE] Support date_range queries Dec 13, 2022
@andersekdahl
Copy link

Was the support for numeric range queries also removed? Any estimates on when it would be added? I might be missing something but it doesn't seem possible to create custom queries for to implement the missing queries in userland in the meantime.

@stevejgordon
Copy link
Contributor

Numeric range queries are tied into date range queries due to the way these are modelled on the server (as a polymorphic range type). That is, in fact, the cause of the edge case bugs we identified, which meant we didn't ship support for these queries yet. As we highlight in the release notes, if you require such features, it's best to wait until the client supports them. These will be a priority for us as a core query type. In the meantime, you can use the 7.x client in compatibility mode. It is also possible to drop down to the raw transport layer to send/receive JSON if you prefer until these are supported in the strongly-typed client.

var bytesResponse = await client.Transport.PostAsync<BytesResponse>("my-index/_search", PostData.Bytes(requestBytes));

@andersekdahl
Copy link

Alright, thanks for the quick reply! I'm considering using 7.x for now then. I guess it'll take some time for the attribute based mapping to get into 8.x as well?

@stevejgordon
Copy link
Contributor

@andersekdahl That sounds like the correct approach for now. Attribute-based mapping is one of the features we are dropping, so that will not return for 8.x.

@andersekdahl
Copy link

I ended up with 8.X instead as I implemented my own attribute based system. Still missing range queries though, any estimate on when that will end up in the SDK? I know I can send queries manually like in the example above but I don't want to generate the entire request body myself just because I need one range filter. Or do you have a snippet I can use to first use a BoolQuery and then patch the JSON with a range query?

If the query classes weren't sealed I could make my own temporary subclass but that doesn't seem possible unless I'm missing something?

@JanFredrikD
Copy link

Are there any updates on this issue?

@stevejgordon
Copy link
Contributor

We don't have an update on timescales for this work and continue to recommend 7.x client until we're in a position to prepare a release with the next set of missing features.

@Alkaersig
Copy link

Oh i just realised that all the range-type queries are missing as i made it to this part of migrating our old v6 based client/solution.

As a pretty import query-type i hope (and it sounds like it) that this has pretty high priority to implement in an upcoming version.

@jacob-winkler
Copy link

+1 for range queries, this is something I would like to see soon also!

@abeninski
Copy link

+1 please add support for range queries or add the ability to execute raw query.

@sharpcoder28
Copy link

I see this got merged to main, but I don't see it in 8.0.7, do we have to wait for 8.1?

@stevejgordon
Copy link
Contributor

@sharpcoder28 This will be part of the 8.1 release. Once we have a few more features completed, we plan to cut a beta package. For now, if you want to try the latest bits, you can access our preview CI feed from https://f.feedz.io/elastic/all/nuget/index.json

@stevejgordon stevejgordon changed the title [FEATURE] Support date_range queries [FEATURE] Support range queries Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to a 8.x client version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants