-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Support point in time searches #5151
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
Conversation
We do this very rarely, largely because we don't do client side validation to enforce required properties. Quite often required properties are contextual. I think in this case it makes a lot of sense.
Using time on responses has some benefits (e.g
Maintaining a 1-1 mapping is key. Long term all of this will be generated. I'd rather focus on the helper.
This is worthy of a discussion on `elastic/elasticsearch for sure.
I think there is a route to do this through |
Co-authored-by: Martijn Laarman <Mpdreamz@gmail.com>
This allows us to special case pit searches to remove the index parameter. Includes new usage tests for doc generation.
I've updated this to support overriding the ResolveUrl method, which I've done for search to handle cases where point in time is in use. This means that consumers are no longer required to know that they must use I thought one thing and wrote another earlier in regards to |
Can this also be specified in the body? If so you can disable its generation by adding a CodeConfigurationFile for it e.g: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
* Support point in time searches * Support override of ResolveUrl This allows us to special case pit searches to remove the index parameter. Includes new usage tests for doc generation.
* Support point in time searches * Support override of ResolveUrl This allows us to special case pit searches to remove the index parameter. Includes new usage tests for doc generation.
* Support point in time searches * Support override of ResolveUrl This allows us to special case pit searches to remove the index parameter. Includes new usage tests for doc generation.
* Support point in time searches (#5151) * Support point in time searches * Support override of ResolveUrl This allows us to special case pit searches to remove the index parameter. Includes new usage tests for doc generation. * manual fixup Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
This PR adds initial support to allow searching over a point in time. It adds a representation of point in time for use in the request and a point in time ID to the response.
During testing, we identified that the current URL resolution for searches against all indices preferred using the _all/_search path. This causes issues with point in time which expects no indices to be specified. I've added logic to
ApiUrls
which detects when we are searching with _all as the path parameter. It then prefers a match against the root /search URL instead. This required a few test assertions elsewhere to be updated.Questions
PointInTime
andPointInTimeDescriptor
since an ID is always necessary and this reduces consumer code. I've not seen this applied much in the non-generated code so perhaps this is negative implications? In my opinion it make consumption simpler for the test cases we have at the moment.By adding this the Fluent syntax is
r.Query(...).AllIndices().PointInTime("an-id")
and the initializer syntax is:I've used the
Time
type forKeepAlive
on thePointInTimeRequest
. This seemed appropriate from other usages, however, theOpenPointInTimeResponse
uses a string at the moment (we could change that if it's preferred?)Would it be nicer if the
OpenPointInTimeResponse
was deserialised into aPointInTime
(without keep alive) so that it could then be passed into the search, rather than creating an instance? One thing to note is this line from the docsSo while convenient for the first request, this might not be super helpful on subsequent searches unless we also converted the pit_id into a
PointInTime
on the search response also. Some of this we may be able to abstract more nicely behind a helper.Should we review if ES should allow PIT searches against _all by opening an issue there? The behaviour right now is valid since _all implies to search everything, while a PIT search limits to the scope of the PIT, however, it forces our consumers to use AllIndices.
Future discussion perhaps - Is there any clean way of inferring AllIndices when PointInTime is used, without the consumer having to specify it, or adding support for this?