You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately v7 seems to a big step backwards in usability of the C# client. In my application I have a relatively small index of a few thousand records which gets regenerated when the source data changes. In v6 this is very simple using SearchIndex.ReplaceAllObjectsAsync.
In v7 there is no such thing and trying to check the documentation doesn't help as it's not been updated for the v7 changes (here for example)
In trying to figure out a migration path for this (since the migration guide doesn't make any mention of this) by digging through the v6 code, I can see that in v6 ReplaceAllObjectsAsync simply indexes the new objects in a temporary index and then uses MoveIndex to replace the live index with the temporary one.
Buy yet again, there is no "MoveIndex" method to be found anywhere. When I look at the new docs page page, what used to be a simple
var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY"));
var index = client.InitIndex("destination");
await index.MoveFromAsync("source");
Appears to now be
var response = await client.OperationIndexAsync(
"<SOURCE_INDEX_NAME>",
new OperationIndexParams
{
Operation = Enum.Parse<OperationType>("Move"),
Destination = "<DESTINATION_INDEX_NAME>",
Scope = new List<ScopeType>
{
Enum.Parse<ScopeType>("Rules"),
Enum.Parse<ScopeType>("Settings")
},
}
);
That is a not a good change IMO and this is only one operation that directly affects my application. I've also found something similar in trying to figure out the new way of batch indexing multiple objects in a single go and that also seems to be equally unwieldy in v7 now.
Hey @lee-m 👋🏻
It seems there was a little confusion around the ReplaceAllOjectsAsync helper, which does exist in the new version of the C# API client, but is not easy to find.
Indeed, when doing a search in the docs, right now, the new API version methods are not well linked... We are working on that, bear with us!
Although, in the new client documentation, you can find that the helper has been indeed ported: under the Helpers section, you'll find it https://www.algolia.com/doc/libraries/csharp/v7/helpers/#replace-all-records
Don't hesitate to re-open this issue if you find that this answer doesn't fit what you were looking for! ☺️
Unfortunately v7 seems to a big step backwards in usability of the C# client. In my application I have a relatively small index of a few thousand records which gets regenerated when the source data changes. In v6 this is very simple using
SearchIndex.ReplaceAllObjectsAsync
.In v7 there is no such thing and trying to check the documentation doesn't help as it's not been updated for the v7 changes (here for example)
In trying to figure out a migration path for this (since the migration guide doesn't make any mention of this) by digging through the v6 code, I can see that in v6
ReplaceAllObjectsAsync
simply indexes the new objects in a temporary index and then uses MoveIndex to replace the live index with the temporary one.Buy yet again, there is no "MoveIndex" method to be found anywhere. When I look at the new docs page page, what used to be a simple
Appears to now be
That is a not a good change IMO and this is only one operation that directly affects my application. I've also found something similar in trying to figure out the new way of batch indexing multiple objects in a single go and that also seems to be equally unwieldy in v7 now.
Originally posted by @lee-m in #852 (comment)
The text was updated successfully, but these errors were encountered: