You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/01/11 08:00:46 UTC

[10/50] [abbrv] lucene-solr:jira/solr-11702: LUCENE-8099: Update MIGRATE.txt

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/jira/solr-11702
Commit: 0c18acb00f3083553e782c916638dfd6bb15cfe9
Parents: 79bd05d
Author: Alan Woodward <ro...@apache.org>
Authored: Fri Jan 5 10:12:03 2018 +0000
Committer: Alan Woodward <ro...@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));