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

DYN-6603 TSplines Lucene Search #14944

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/DynamoCore/Utilities/LuceneSearchUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ internal Document InitializeIndexDocumentForPackages()
internal void SetDocumentFieldValue(Document doc, string field, string value, bool isTextField = true, bool isLast = false)
{
string[] indexedFields = null;
const string tsplinesNodesCategory = "tspline";

if (startConfig.Directory.Equals(LuceneConfig.NodesIndexingDirectory))
{
indexedFields = LuceneConfig.NodeIndexFields;
Expand All @@ -247,6 +249,10 @@ internal void SetDocumentFieldValue(Document doc, string field, string value, bo
if (isTextField && !field.Equals("DocName"))
{
((TextField)doc.GetField(field)).SetStringValue(value);

//Index-time boost, incremeting the weight for TSpline nodes
if (!string.IsNullOrEmpty(value) && value.ToLower().Contains(tsplinesNodesCategory))
((TextField)doc.GetField(field)).Boost += 1;
}
else
{
Expand Down
Loading