@@ -14,12 +14,12 @@ public void FunctionScoreQuery()
1414 . FunctionScore ( fs => fs
1515 . Query ( qq => qq . MatchAll ( ) )
1616 . Functions (
17- f => f . Weight ( 3.0 ) . Filter ( ff => ff . Term ( p => p . Name , "elasticsearch" ) ) ,
17+ f => f . Weight ( 3.0 ) . Filter ( ff => ff . Term ( p => p . Name , "elasticsearch" ) ) ,
1818 f => f . Gauss ( x => x . StartedOn , d => d . Scale ( "42w" ) ) ,
1919 f => f . Linear ( x => x . FloatValue , d => d . Scale ( "0.3" ) ) ,
2020 f => f . Exp ( x => x . DoubleValue , d => d . Scale ( "0.5" ) ) ,
2121 f => f . BoostFactor ( 2.0 ) ,
22- f => f . FieldValueFactor ( op => op . Field ( ff => ff . DoubleValue ) . Factor ( 2.5 ) . Modifier ( FieldValueFactorModifier . SquareRoot ) )
22+ f => f . FieldValueFactor ( op => op . Field ( ff => ff . DoubleValue ) . Factor ( 2.5 ) . Modifier ( FieldValueFactorModifier . SquareRoot ) . Missing ( 1.0 ) )
2323 )
2424 . ScoreMode ( FunctionScoreMode . Sum )
2525 . BoostMode ( FunctionBoostMode . Replace )
@@ -28,21 +28,21 @@ public void FunctionScoreQuery()
2828
2929 var json = TestElasticClient . Serialize ( s ) ;
3030 var expected = @"{
31- from: 0, size: 10,
32- fields: [""content""],
31+ from: 0, size: 10,
32+ fields: [""content""],
3333 query : {
34- function_score : {
35- functions: [
34+ function_score : {
35+ functions: [
3636 {weight: 3.0, filter: { term: { 'name': 'elasticsearch' }}},
37- {gauss: { startedOn : { scale: '42w'}}},
38- {linear: { floatValue : { scale: '0.3'}}},
39- {exp: { doubleValue: { scale: '0.5'}}},
40- {boost_factor: 2.0 },
41- {field_value_factor: { field: 'doubleValue', factor: 2.5, modifier: 'sqrt'}}
42- ],
37+ {gauss: { startedOn : { scale: '42w'}}},
38+ {linear: { floatValue : { scale: '0.3'}}},
39+ {exp: { doubleValue: { scale: '0.5'}}},
40+ {boost_factor: 2.0 },
41+ {field_value_factor: { field: 'doubleValue', factor: 2.5, modifier: 'sqrt', missing: 1.0 }}
42+ ],
4343 query : { match_all : {} },
44- score_mode: 'sum',
45- boost_mode: 'replace',
44+ score_mode: 'sum',
45+ boost_mode: 'replace',
4646 }
4747 }
4848 }" ;
@@ -62,9 +62,9 @@ public void FunctionScoreQueryWithJustWeight()
6262
6363 var json = TestElasticClient . Serialize ( s ) ;
6464 var expected = @"{
65- from: 0, size: 10,
65+ from: 0, size: 10,
6666 query : {
67- function_score : {
67+ function_score : {
6868 query : { match_all : {} },
6969 weight : 2.0
7070 }
@@ -85,7 +85,7 @@ public void FunctionScoreQueryConditionless()
8585 f => f . Linear ( x => x . FloatValue , d => d . Scale ( "0.3" ) ) ,
8686 f => f . Exp ( x => x . DoubleValue , d => d . Scale ( "0.5" ) ) ,
8787 f => f . BoostFactor ( 2 ) ,
88- f => f . FieldValueFactor ( db => db . Field ( fa => fa . DoubleValue ) . Factor ( 3.4 ) . Modifier ( FieldValueFactorModifier . Ln ) )
88+ f => f . FieldValueFactor ( db => db . Field ( fa => fa . DoubleValue ) . Factor ( 3.4 ) . Modifier ( FieldValueFactorModifier . Ln ) . Missing ( 1.4 ) )
8989 )
9090 . ScoreMode ( FunctionScoreMode . Sum )
9191 . BoostMode ( FunctionBoostMode . Replace )
@@ -94,19 +94,19 @@ public void FunctionScoreQueryConditionless()
9494
9595 var json = TestElasticClient . Serialize ( s ) ;
9696 var expected = @"{
97- from: 0, size: 10,
98- fields: [""content""],
97+ from: 0, size: 10,
98+ fields: [""content""],
9999 query : {
100- function_score : {
101- functions: [
102- {gauss: { startedOn : { scale: '42w'}}},
103- {linear: { floatValue : { scale: '0.3'}}},
104- {exp: { doubleValue: { scale: '0.5'}}},
105- {boost_factor: 2.0 },
106- {field_value_factor: { field: 'doubleValue', factor: 3.4, modifier: 'ln'}}
107- ],
108- score_mode: 'sum',
109- boost_mode: 'replace',
100+ function_score : {
101+ functions: [
102+ {gauss: { startedOn : { scale: '42w'}}},
103+ {linear: { floatValue : { scale: '0.3'}}},
104+ {exp: { doubleValue: { scale: '0.5'}}},
105+ {boost_factor: 2.0 },
106+ {field_value_factor: { field: 'doubleValue', factor: 3.4, modifier: 'ln', missing: 1.4 }}
107+ ],
108+ score_mode: 'sum',
109+ boost_mode: 'replace',
110110 }
111111 }
112112 }" ;
0 commit comments