lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romseyg...@apache.org
Subject lucene-solr:master: LUCENE-8099: Update MIGRATE.txt
Date Fri, 05 Jan 2018 10:12:09 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 79bd05da4 -> 0c18acb00


LUCENE-8099: Update MIGRATE.txt


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/0c18acb0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0c18acb0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0c18acb0

Branch: refs/heads/master
Commit: 0c18acb00f3083553e782c916638dfd6bb15cfe9
Parents: 79bd05d
Author: Alan Woodward <romseygeek@apache.org>
Authored: Fri Jan 5 10:12:03 2018 +0000
Committer: Alan Woodward <romseygeek@apache.org>
Committed: Fri Jan 5 10:12:03 2018 +0000

----------------------------------------------------------------------
 lucene/MIGRATE.txt | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0c18acb0/lucene/MIGRATE.txt
----------------------------------------------------------------------
diff --git a/lucene/MIGRATE.txt b/lucene/MIGRATE.txt
index 9d02db8..d486a21 100644
--- a/lucene/MIGRATE.txt
+++ b/lucene/MIGRATE.txt
@@ -19,12 +19,14 @@ FunctionScoreQuery maps negative values to 0.
 
 ## CustomScoreQuery, BoostedQuery and BoostingQuery removed (LUCENE-8099) ##
 
-Instead use FunctionScoreQuery and a DoubleValuesSource implementation.  For example,
-to replace the functionality of BoostedQuery, you could do the following, using
-the lucene-expressions module:
+Instead use FunctionScoreQuery and a DoubleValuesSource implementation.  BoostedQuery
+and BoostingQuery may be replaced by calls to FunctionScoreQuery.boostByValue() and
+FunctionScoreQuery.boostByQuery().  To replace more complex calculations in
+CustomScoreQuery, use the lucene-expressions module:
 
 SimpleBindings bindings = new SimpleBindings();
 bindings.add("score", DoubleValuesSource.SCORES);
-bindings.add("boost", DoubleValuesSource.fromIntField("myboostfield"));
-Expression expr = JavascriptCompiler.compile("score * boost");
+bindings.add("boost1", DoubleValuesSource.fromIntField("myboostfield"));
+bindings.add("boost2", DoubleValuesSource.fromIntField("myotherboostfield"));
+Expression expr = JavascriptCompiler.compile("score * (boost1 + ln(boost2))");
 FunctionScoreQuery q = new FunctionScoreQuery(inputQuery, expr.getDoubleValuesSource(bindings));


Mime
View raw message