-
Notifications
You must be signed in to change notification settings - Fork 635
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
DYN-6037 lucene overloaded nodes #14136
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -965,14 +965,15 @@ internal IEnumerable<NodeSearchElementViewModel> Search(string search, bool useL | |
string name = resultDoc.Get(nameof(LuceneConfig.IndexFieldsEnum.Name)); | ||
string docName = resultDoc.Get(nameof(LuceneConfig.IndexFieldsEnum.DocName)); | ||
string cat = resultDoc.Get(nameof(LuceneConfig.IndexFieldsEnum.FullCategoryName)); | ||
string parameters = resultDoc.Get(nameof(LuceneConfig.IndexFieldsEnum.Parameters)); | ||
|
||
if (!string.IsNullOrEmpty(docName)) | ||
{ | ||
//code for setting up documentation info | ||
} | ||
else | ||
{ | ||
var foundNode = FindViewModelForNodeNameAndCategory(name, cat); | ||
var foundNode = FindViewModelForNodeNameAndCategory(name, cat, parameters); | ||
if (foundNode != null) | ||
{ | ||
candidates.Add(foundNode); | ||
|
@@ -992,13 +993,17 @@ internal IEnumerable<NodeSearchElementViewModel> Search(string search, bool useL | |
/// </summary> | ||
/// <param name="nodeName">Name of the node</param> | ||
/// <param name="nodeCategory">Full Category of the node</param> | ||
/// <param name="parameters">Node input parameters</param> | ||
/// <returns></returns> | ||
private NodeSearchElementViewModel FindViewModelForNodeNameAndCategory(string nodeName, string nodeCategory) | ||
private NodeSearchElementViewModel FindViewModelForNodeNameAndCategory(string nodeName, string nodeCategory, string parameters) | ||
{ | ||
var result = Model.SearchEntries.Where(e => { | ||
if (e.Name.Equals(nodeName) && e.FullCategoryName.Equals(nodeCategory)) | ||
{ | ||
return true; | ||
if (e.Parameters == null) | ||
return string.IsNullOrEmpty(parameters); | ||
else | ||
return e.Parameters.Equals(parameters); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you put comments for this block, not too intuitive to me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added more comments please let me know if the explanation is clear. Thanks |
||
} | ||
return false; | ||
}); | ||
|
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.
Change the Enum name from IndexFieldsEnum to NodeIndexFields, as it is specific to that?
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.
agreed
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've renamed IndexFieldsEnum to NodeIndexFields
commit: fab8b07
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.
Sorry for the confusion, I just saw that the same enum property is used in PackageIndexFields also and one of the enum values is "Hosts". Not a big deal, you can revert this last name change if you want.