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

AO-10: Searching with multiple words should narrow the search, not broaden it #98

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

Conversation

ibacher
Copy link
Member

@ibacher ibacher commented Apr 2, 2021

No description provided.

@@ -120,10 +121,10 @@ public void index(AddOnInfoAndVersions infoAndVersions) throws IOException {
boolQB.should(QueryBuilders.prefixQuery("name", query).boost(8.0f));

//Query is subset of module name(Medium priority)
boolQB.should(QueryBuilders.matchQuery("name", query).boost(4.0f));
boolQB.should(QueryBuilders.matchQuery("name", query).operator(MatchQueryBuilder.Operator.AND).boost(2.0f));
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
boolQB.should(QueryBuilders.matchQuery("name", query).operator(MatchQueryBuilder.Operator.AND).boost(2.0f));
boolQB.should(QueryBuilders.matchQuery("name", query).operator(MatchQueryBuilder.Operator.AND).boost(4.0f));


//Description matches query either completely or partially(Low priority)
boolQB.should(QueryBuilders.matchQuery("description", query).boost(2.0f));
boolQB.should(QueryBuilders.matchQuery("description", query).operator(MatchQueryBuilder.Operator.AND).boost(0.5f));
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
boolQB.should(QueryBuilders.matchQuery("description", query).operator(MatchQueryBuilder.Operator.AND).boost(0.5f));
boolQB.should(QueryBuilders.matchQuery("description", query).operator(MatchQueryBuilder.Operator.AND).boost(2.0f));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants