Sitecore CLI 4.0.0 Indexing Plugin dry-run

The Sitecore CLI is based on the client/server architecture:


Based on the same, you have to:

2.a Install Sitecore Management Services 4.0.0 onto the Sitecore instance
2.b Login from CLI and interact with the Sitecore instance

Points 2.a and 2.b along with some overlap with regard to plugin install are depicted in the diagram below using Indexing plugin as example:


You can always run the help command at any level. If you run at the first-level, dotnet sitecore --help, here is the result:


Based on the above results, its clear I've installed both of the new plugins namely, indexing and resourcepackage on this machine, you can check the same in the file system:


Now, let's make a baby step by checking the list of indexes in the connected Sitecore instance:


Note that help is supported at dotnet sitecore index --help

Based on that, I know I can get the index list using this command:  dotnet sitecore index list

Now, let's get one step ahead and do an index rebuild. In prior versions of Sitecore, we had to get to the Sitecore instance' control panel to perform a index rebuild. But, not anymore!

From the PS window, you can run a index rebuild on the instance:


Index rebuild finished:


Next, you can populate the schema using the following command:

dotnet sitecore index schema_populate


When I run dotnet sitecore index statistic I receive this error:


GraphQL.ExecutionError: Error trying to resolve indexesStatistic. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Sitecore.ContentSearch.SolrProvider.SolrIndexSummary.get_NumberOfDocuments()
   at Sitecore.DevEx.GraphQL.Indexing.Services.IndexStatisticService.GetIndexStatistic(ISearchIndex index)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at GraphQL.Execution.ExecutionStrategy.SetArrayItemNodes(ExecutionContext context, ArrayExecutionNode parent)
   at GraphQL.Execution.ExecutionStrategy.<ExecuteNodeAsync>d__7.MoveNext()
   --- End of inner exception stack trace ---

Think, I will check and fix this in a separate blog. 

The indexing plugin is a good addition to your post-install/deploy script.

That's all for now!

Comments

Popular Posts