-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Try to streamline the update api's #795
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
…d Bulk(Update()) and made them consistent
Ok huge breaking change post RC1 but I feel its worth swollowing our pride to come up with a better public API
in the update and bulk update api the Furthermore the generic type names for See: For some actual examples. |
@Mpdreamz I think this is much better. My only suggestion would be to maybe rename Id(T doc) to IdFrom(T doc). I think the latter is a bit more clear on what the intentions of the method are (inferring the Id from the given document). What do you think? |
For consistency and alignment with ES itself, I would prefer to see Just .Doc() and .DocAsUpsert(), with an error thrown if the specified doc didn't provide an ID along with the partial update fields. Without knowing any NEST specifics, that's the usage I would have inferred from glancing at ES docs. |
Thats the confusing part. The
Is also valid update statement, we currently already throw if we can not get an id and the object initializer syntax forces you to specify an id on the constructor. But your point is valid, now we no longer have Thoughts? @gmarz i'm +1 on |
That makes sense. I'd go with |
I'm a bit torn here. While I like the verbosity of PartialDocument and the fact that it's more C#-ish, if you will, I still think it might be confusing to some people because they're going to be looking for the matching Doc property from the Elasticsearch DSL. The majority of the time, NEST maps 1-to-1 with the ES DSL names, so I think we should stay consistent here. I'm +1 for . |
Ok so thats 2-1 in favour of |
👍 |
…umentAsUpsert() to DocAsUpsert()
LGTM |
Try to streamline the update api's
I've just updated nuget to 1.0.0. There are breaking changes after ID() renamed Id(T) to IdFrom(T), PartialDocument() to Doc() and PartialDocumentAsUpsert() to DocAsUpsert(). |
And come up with an API thats verbose in its intend leaving no room for confusion.