Browse Source

[Docs] Remove `custom_score` from documentation and add a migration
section.

Simon Willnauer 11 years ago
parent
commit
990ce658a4

+ 2 - 0
docs/reference/migration/migrate_1_0.asciidoc

@@ -360,3 +360,5 @@ in the query string.
 * The `path` parameter in mappings has been deprecated. Use the
   <<copy-to,`copy_to`>> parameter instead.
 
+* The `custom_score` and `custom_boost_score` is no longer supported. You can
+  use <<query-dsl-function-score-query,`function_score`>> instead.

+ 1 - 1
docs/reference/search/request/sort.asciidoc

@@ -287,7 +287,7 @@ Allow to sort based on custom scripts, here is an example:
 --------------------------------------------------
 
 Note, it is recommended, for single custom based script based sorting,
-to use `custom_score` query instead as sorting based on score is faster.
+to use `function_score` query instead as sorting based on score is faster.
 
 ==== Track Scores
 

+ 0 - 12
src/test/java/org/elasticsearch/index/query/SimpleIndexQueryParserTests.java

@@ -1355,18 +1355,6 @@ public class SimpleIndexQueryParserTests extends ElasticsearchTestCase {
         assertThat(((TermFilter) constantScoreQuery.getFilter()).getTerm(), equalTo(new Term("name.last", "banon")));
     }
 
-    // Disabled since we need a current context to execute it...
-//    @Test public void testCustomScoreQuery1() throws IOException {
-//        IndexQueryParser queryParser = queryParser();
-//        String query = copyToStringFromClasspath("/org/elasticsearch/index/query/custom_score1.json");
-//        Query parsedQuery = queryParser.parse(query).query();
-//        assertThat(parsedQuery, instanceOf(FunctionScoreQuery.class));
-//        FunctionScoreQuery functionScoreQuery = (FunctionScoreQuery) parsedQuery;
-//        assertThat(((TermQuery) functionScoreQuery.getSubQuery()).getTerm(), equalTo(new Term("name.last", "banon")));
-//        assertThat(functionScoreQuery.getFunction(), instanceOf(CustomScoreQueryParser.ScriptScoreFunction.class));
-//    }
-
-
     @Test
     public void testCustomBoostFactorQueryBuilder_withFunctionScore() throws IOException {
         IndexQueryParserService queryParser = queryParser();