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

updated query boosting #647

Merged
merged 2 commits into from
Sep 12, 2017
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ public void additionalSearchParameters(Context context,
{
String query = discoveryQuery.getQuery();
// follows previous impl, but is it correct?
if (query == null)
{
if (query == null) {
query = "*:*";
} else {
query = "+(" + query + ")"

Choose a reason for hiding this comment

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

which solr query parser is being used?
comment on what was tried to be achieved here

Choose a reason for hiding this comment

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

you can use the description from http://stackoverflow.com/questions/27867174/how-to-tell-the-logic-like-plus-sign-with-or-in-solr including the linked article but it should be part of the code so ppl understand it

+ " OR title:(" + query + ")^2"
+ " OR dc.relation.replaces:[* TO *]^2"
+ " OR (dc.relation.replaces:[* TO *] AND -dc.relation.isreplacedby:[* TO *])^2";
}
String q = solrQuery.getQuery() + " OR title:(" + query + ")^5";
q = q + " OR ((" + q + ") AND -dc.relation.isreplacedby:*)^5 OR ((" + q + ") AND dc.relation.replaces:*)^15";
solrQuery.setQuery(q);

solrQuery.setQuery(query);
}

@Override
Expand Down