Skip to content
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

Feature/758 add the ability to add search indexes to existing instances #784

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

YevhenPetlovanyi
Copy link
Collaborator

No description provided.

{
int firstDigit = int.Parse(solrVersion[0].ToString());

if (firstDigit >= 7)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible not rely on digit 7 in this case? This looks like hardcode.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to check the Solr version is seven or higher


public string SolrVersion;

public string SolrFolder;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an indent between these properties.

return;
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the unnecessary line.


namespace SIM.Pipelines.InstallSearchIndexes
{
public class CreateSolrCoreAction : InstallSearchIndexesProcessor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the "Action" suffix from the name since it is a processor?


namespace SIM.Pipelines.InstallSearchIndexes
{
public class PopulateNewIndexAction : InstallSearchIndexesProcessor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the "Action" suffix from the name since it is a processor?
In addition, I would suggest changing its name to "PopulateManagedSchema".


private XmlDocumentEx GetXmlDocumenFromSolrResponse(string solrInfoUrl)
{
Stream response = RequestAndGetResponseStream(solrInfoUrl);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space.


namespace SIM.Tool.Windows.MainWindowComponents.Helpers
{
public class ButtonAuthenticationHelper
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider renaming it to "SitecoreAuthenticationHelper" because it should be more obvious what functionality this class provides.


if (!solrStateResolver.IsSolrAvailable(solrUrl))
{
WindowHelper.ShowMessage($"Failed to access Solr at the following URL: {solrUrl}.\r\n Solr is not available.\r\nPlease make sure Solr is running and accessible.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the space before "Solr is not available.".

}
}

SearchIndexesListBox.DataContext = CoreNamesCheckBoxItems;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case no search indexes are available to be processed, it is better to add a message (label) instead of showing the empty list:
image

It shows related cores that are missing on the Solr side and allows you to add them. "" />
<step name=""STEP 2 of 2 - INSTALL SOLR CORES""
type=""SIM.Tool.Windows.UserControls.Install.SearchIndexes.AvailableSearchIndexes, SIM.Tool.Windows"" />
</steps>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove two spaces before the steps closing tag.


namespace SIM.Pipelines.InstallSearchIndexes
{
public abstract class InstallSearchIndexesProcessor : Processor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If one processor fails, other processors should be in the Pending state:
image

private void CreateIndexDirectory(string solrVersion, string solrFolder, string newCorePath)
{
string sourcePath = GetSourceConfPath(solrVersion, solrFolder);
FileSystem.FileSystem.Local.Directory.Copy(sourcePath, newCorePath, recursive: true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "sourcePath" folder may not exist.

@@ -1158,6 +1164,7 @@ private static GroupDefinition GetManageGroupDefinition()
new ButtonDefinition { Label = "Restore", Image = "/Images/$sm/box_out.png, SIM.Tool.Windows", Handler = new RestoreInstanceButton() },
new ButtonDefinition { Handler = new ExportInstanceButton() },
new ButtonDefinition { Label = "Export", Image = "/Images/$sm/download.png, SIM.Tool.Windows", Handler = new ExportInstanceButton() },
new ButtonDefinition { Label = "Add Solr cores", Image = "/Images/$sm/search_index.png, SIM.Tool.Windows", Handler = new AddSolrCoresButton() },
Copy link
Collaborator

@DmitryKolinchuk DmitryKolinchuk Apr 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The icon quality is very low in the context menu.
Try to use:
Image = "/Images/32/search_index.png
Or:
Image = "/Images/$lg/search_index.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To be triaged
Development

Successfully merging this pull request may close these issues.

Add the ability to add search indexes to existing instances
2 participants