DYN-5795 Lucene Search Weights#14062
Merged
QilongTang merged 1 commit intoDynamoDS:masterfrom Jun 13, 2023
RobertGlobant20:DYN-5795-Lucene-Search-Weights
Merged
DYN-5795 Lucene Search Weights#14062QilongTang merged 1 commit intoDynamoDS:masterfrom RobertGlobant20:DYN-5795-Lucene-Search-Weights
QilongTang merged 1 commit intoDynamoDS:masterfrom
RobertGlobant20:DYN-5795-Lucene-Search-Weights
Conversation
The hard-coded values for the field names were moved to the Configurations class and all the places in which this names were used were replaced. Also in the SearchViewModel.Search() method I've done minor changes to consider the wildcard expression * keyword *
Contributor
Author
reddyashish
approved these changes
Jun 13, 2023
QilongTang
reviewed
Jun 13, 2023
| /// <summary> | ||
| /// This represent the fields that will be indexed when initializing Lucene Search | ||
| /// </summary> | ||
| public enum IndexFieldsEnum |
Contributor
There was a problem hiding this comment.
I think this is fine place for now, I may move these to dedicated Lucene config file later in my PR
QilongTang
reviewed
Jun 13, 2023
| wildcardQuery = new WildcardQuery(new Term(f, s + "*")); | ||
| if (f.Equals("Name")) { wildcardQuery.Boost = 5; } | ||
| else { wildcardQuery.Boost = 2; } | ||
| wildcardQuery = new WildcardQuery(new Term(f, "*" + s + "*")); |
Contributor
There was a problem hiding this comment.
This probably could benefit with some comments
QilongTang
approved these changes
Jun 13, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Purpose
Minor changes in the Lucene Search functionality
The hard-coded values for the field names were moved to the Configurations class and all the places in which this names were used were replaced. Also in the SearchViewModel.Search() method I've done minor changes to consider the wildcard expression * keyword *.
The next fields were removed: "InputParameters", "OutputParameters", "PackageName", "PackageVersion" due that are not used in the Legacy Search and neither in the Lucene search.
TODO - There is still a functionality that I think should be implemented (but not sure about it):


In the Legacy Search at indexing time each keyword (SearchKeywords) has assigned a specific weight between 0.0 - 1.0 (SearchKeywordsWeight) but when running the query those weights are used for sorting the results, in comparison, in the Lucene Search we are assigning a fixed weights for all the tags (see image attached), then for fixing this case we need to convert the SearchKeywords weights from 0.0-1.0 to 1 - 10 scale and set the right Boost value for each word, I think this should be implemented in the string CreateSearchQuery(string[] fields, string searchKey) method.
@reddyashish
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Minor changes in the Lucene Search functionality
Reviewers
@QilongTang @reddyashish
FYIs