-
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-7273 Search Issue Civil3D #15420
Merged
QilongTang
merged 5 commits into
DynamoDS:master
from
RobertGlobant20:DYN-7273-SearchIssue-Civil3D
Aug 16, 2024
+35
−1
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0680313
DYN-7273 Search Issue Civil3D
RobertGlobant20 29c7f5a
DYN-6620 Add version size data to Package Details
RobertGlobant20 8a4ff1c
DYN-7273 Search Issue Civil3D
RobertGlobant20 317653b
DYN-7273 Search Issue Civil3D
RobertGlobant20 824b0b5
Merge branch 'master' into DYN-7273-SearchIssue-Civil3D
RobertGlobant20 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -379,7 +379,6 @@ internal string CreateSearchQuery(string[] fields, string SearchTerm, bool IsPac | |
{ | ||
//Means that the first term is a category when we will be using the FullCategoryName for making a specific search based in the category | ||
trimmedSearchTerm = matchingCategory?.FullCategoryName; | ||
occurQuery = Occur.MUST; | ||
} | ||
else if (f == nameof(LuceneConfig.NodeFieldsEnum.Name) && firstTermIsCategory == true) | ||
{ | ||
|
@@ -409,6 +408,22 @@ internal string CreateSearchQuery(string[] fields, string SearchTerm, bool IsPac | |
|
||
if (searchTerm.Contains(' ')) | ||
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 we somehow combine this and the 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. |
||
{ | ||
//Added due that the Search algorithm was not matching the exact name when searchTerm contain empty spaces | ||
if (!string.IsNullOrEmpty(searchTerm) && f == nameof(LuceneConfig.NodeFieldsEnum.Name)) | ||
{ | ||
//I had to use the use the WildcardQuery class directly to set the weight(Boost) to the default value (instead of using the one calculated by the CalculateFieldWeight() method | ||
var wildcardQueryWithEmptySpace = new WildcardQuery(new Term(f, "*" + searchTerm + "*")); | ||
|
||
//PhraseQuery will escape whitespace characters trying to match the exact phrase | ||
var phraseQuery = new PhraseQuery | ||
{ | ||
new Term(f, searchTerm), | ||
}; | ||
|
||
booleanQuery.Add(phraseQuery, occurQuery); | ||
booleanQuery.Add(wildcardQueryWithEmptySpace, occurQuery); | ||
} | ||
|
||
foreach (string s in searchTerm.Split(' ', '.')) | ||
{ | ||
//If is a ByEmptySpace search and the splitted words match with more than MaxNodeNamesRepeated nodes then the word is skipped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Reason behind removing this?
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.
when searching for criteria like "file path" with MUST we were creating a query like this one (consider that the word 'file' is a Category):
SELECT .... FROM ..... WHERE CATEGORY = 'file' AND (NAME LIKE 'path' or NAME LIKE ''path*)
so it was returning the two nodes in which Category = 'Core.File' that match the criteria related with the Name (the Name should contain 'path'),
But the user is expecting the "file path" node - this one didn't match due that belongs to the Category = "Core.Input" so removing the MUST makes the query more flexible showing also the nodes that matches the Name = 'file path' OR the Category = "Core.File".
Please let me know if this is clear enough.