-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Support reindex with to better syntax #1440
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
var page = 0; | ||
Func<SearchDescriptor<T>, SearchDescriptor<T>> searchDescriptor = s => s.Index(fromIndex); | ||
|
||
if (typeof(T).Name.Equals(typeof(object).Name)) |
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 think this fix should be moved to the non generic overload, this might still cause confusion when someone actually calls Reindex<objecT>()
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 i did not understand this one :). What should we do if it comes as generic object? I thought the idea was to search all types?
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.
Here: https://github.com/elastic/elasticsearch-net/blob/1433-support-generic-reindex/src/Nest/ElasticClient-Reindex.cs#L19 we added a non generic overload to the client. However we can not distinguish here between someone calling the generic or non generic overload. If someone now calls client.Reindex<object>()
it will reindex on everything where as only client.Reindex()
should.
…into 1433-support-generic-reindex
@@ -14,5 +14,11 @@ public IObservable<IReindexResponse<T>> Reindex<T>(Func<ReindexDescriptor<T>, Re | |||
var observable = new ReindexObservable<T>(this, _connectionSettings, reindexDescriptor); | |||
return observable; | |||
} | |||
|
|||
/// <inheritdoc /> | |||
public IObservable<IReindexResponse<IDocument>> Reindex(Func<ReindexDescriptor<object>, ReindexDescriptor<object>> reindexSelector) |
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.
To be truly lazy IDocument
this signature needs to change to Reindex(Func<ReindexDescriptor<IDocument>, ReindexDescriptor<IDocument>> reindexSelector)
@Mpdreamz is this what you expected? I dont know but something is telling me that i've missed something :) |
err meant #1404 there :) |
No this looks good to me! 👍 |
Support reindex with to better syntax
Support for #1433