mirror of https://github.com/apache/lucene.git
SOLR-628 -- enable runtime 'forceElevation' changes
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@735117 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
088ad18d2b
commit
afe37144ea
|
@ -319,6 +319,9 @@ public class QueryElevationComponent extends SearchComponent implements SolrCore
|
|||
if( !params.getBool( ENABLE, true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// A runtime parameter can alter the config value for forceElevation
|
||||
boolean force = params.getBool( FORCE_ELEVATION, forceElevation );
|
||||
|
||||
Query query = rb.getQuery();
|
||||
if( query == null ) {
|
||||
|
@ -364,7 +367,7 @@ public class QueryElevationComponent extends SearchComponent implements SolrCore
|
|||
SortField[] current = sortSpec.getSort().getSort();
|
||||
ArrayList<SortField> sorts = new ArrayList<SortField>( current.length + 1 );
|
||||
// Perhaps force it to always sort by score
|
||||
if( forceElevation && current[0].getType() != SortField.SCORE ) {
|
||||
if( force && current[0].getType() != SortField.SCORE ) {
|
||||
sorts.add( new SortField(idField,
|
||||
new ElevationComparatorSource(booster.priority), false ) );
|
||||
modify = true;
|
||||
|
|
Loading…
Reference in New Issue