-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Support Ids in MultiTermVectors API #3382
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
This commit adds support for providing a set of Ids to MultiTermVectors API to be used in conjunction with index and type provided in the URI. Index() and Type() methods added to MultiTermVectorOperation to allow the default typeof(T) values to be overidden. Closes #3219
|
||
protected override object ExpectJson { get; } = new | ||
{ | ||
ids = Developer.Developers.Select(p => (Id)p.Id).Take(2) |
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.
Balmer-object orientation.
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.
I thought about providing overloads for string
, long
, Guid
, etc. much like the existing GetMany<T>(...)
.
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.
Could be useful, but easy to add later :)
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.
that's what I err'ed on!
protected override void ExpectResponse(IMultiTermVectorsResponse response) | ||
{ | ||
response.ShouldBeValid(); | ||
response.Documents.Should().NotBeEmpty().And.HaveCount(2).And.OnlyContain(d => d.Found); |
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.
And.OnlyContain... nice!
get { return this._operations; } | ||
set { this._operations = value?.ToList(); } | ||
get => this._operations; | ||
set => this._operations = value?.ToList(); |
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.
Just out of curiosity, is there any reason why we .ToList()
on setters like this; other than to force the execution of the IEnumerable
at this point? Seems like we could save some allocations in these instances...
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.
I don't know about this specific case, but in general would be to force execution as you say.
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.
What is unusual with respect to the general API design in NEST, is that GetMany<T>(..)
is additive rather than assignative to the operations. I understand why this is, and it's not the only place where a method call is additive
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.
@Mpdreamz - would be able to offer any insight?
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.
Places where we are additive is AFAIK only in the bulk related API helpers since you can IndexMany
and then IndexMany<Y>
afterwards in a single bulk. That was the rationale behind the deviation. Definitely up for further discussion 😄
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.
Changes look good. ++ on documentation. Minor question raised on the .ToList()
setter, but its a common pattern already, so no need to hold back the code for this.
|
This commit adds support for providing a set of Ids to MultiTermVectors API to be used in conjunction with index and type provided in the URI. Index() and Type() methods added to MultiTermVectorOperation to allow the default typeof(T) values to be overidden. Closes #3219
This commit adds support for providing a set of Ids to MultiTermVectors API to be used in conjunction with index and type provided in the URI. Index() and Type() methods added to MultiTermVectorOperation to allow the default typeof(T) values to be overidden. Closes #3219
This commit adds support for providing a set of Ids to MultiTermVectors API to be used in conjunction with index and type provided in the URI. Index() and Type() methods added to MultiTermVectorOperation to allow the default typeof(T) values to be overidden. Closes #3219 (cherry picked from commit 491a4a4)
This commit adds support for providing a set of Ids to MultiTermVectors API to be used in
conjunction with index and type provided in the URI.
Index() and Type() methods added to MultiTermVectorOperation to allow the default typeof(T)
values to be overidden.
Closes #3219