Skip to content

v7 Migration questions #862

Closed
Closed
@morganleroi

Description

@morganleroi

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.

Originally posted by @lee-m in #852 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions