66 */
77package org .elasticsearch .xpack .esql .core .expression .predicate .fulltext ;
88
9- import org .elasticsearch .TransportVersions ;
109import org .elasticsearch .common .io .stream .NamedWriteableRegistry ;
1110import org .elasticsearch .common .io .stream .StreamInput ;
12- import org .elasticsearch .common .io .stream .StreamOutput ;
13- import org .elasticsearch .common .unit .Fuzziness ;
1411import org .elasticsearch .xpack .esql .core .expression .Expression ;
1512import org .elasticsearch .xpack .esql .core .tree .NodeInfo ;
1613import org .elasticsearch .xpack .esql .core .tree .Source ;
@@ -30,48 +27,16 @@ public class MatchQueryPredicate extends FullTextPredicate {
3027 );
3128
3229 private final Expression field ;
33- private final Double boost ;
34- private final Fuzziness fuzziness ;
3530
3631 public MatchQueryPredicate (Source source , Expression field , String query , String options ) {
3732 super (source , query , options , singletonList (field ));
3833 this .field = field ;
39- this .boost = null ;
40- this .fuzziness = null ;
41- }
42-
43- public MatchQueryPredicate (Source source , Expression field , String query , Double boost , Fuzziness fuzziness ) {
44- super (source , query , null , singletonList (field ));
45- this .field = field ;
46- this .boost = boost ;
47- this .fuzziness = fuzziness ;
4834 }
4935
5036 MatchQueryPredicate (StreamInput in ) throws IOException {
5137 super (in );
5238 assert super .children ().size () == 1 ;
5339 field = super .children ().get (0 );
54- if (TransportVersions .MATCH_OPERATOR_FUZZINESS_BOOSTING .onOrAfter (in .getTransportVersion ())) {
55- boost = in .readOptionalDouble ();
56- fuzziness = in .readOptionalWriteable (Fuzziness ::new );
57- } else {
58- boost = null ;
59- fuzziness = null ;
60- }
61- }
62-
63- @ Override
64- public void writeTo (StreamOutput out ) throws IOException {
65- super .writeTo (out );
66- if (TransportVersions .MATCH_OPERATOR_FUZZINESS_BOOSTING .onOrAfter (out .getTransportVersion ())) {
67- out .writeOptionalDouble (boost );
68- out .writeOptionalWriteable (fuzziness );
69- }
70- }
71-
72- @ Override
73- public String getWriteableName () {
74- return ENTRY .name ;
7540 }
7641
7742 @ Override
@@ -81,7 +46,7 @@ protected NodeInfo<MatchQueryPredicate> info() {
8146
8247 @ Override
8348 public MatchQueryPredicate replaceChildren (List <Expression > newChildren ) {
84- return new MatchQueryPredicate (source (), newChildren .get (0 ), query (), boost (), fuzziness ());
49+ return new MatchQueryPredicate (source (), newChildren .get (0 ), query (), options ());
8550 }
8651
8752 public Expression field () {
@@ -90,23 +55,20 @@ public Expression field() {
9055
9156 @ Override
9257 public int hashCode () {
93- return Objects .hash (field , super .hashCode (), boost , fuzziness );
58+ return Objects .hash (field , super .hashCode ());
9459 }
9560
9661 @ Override
9762 public boolean equals (Object obj ) {
9863 if (super .equals (obj )) {
9964 MatchQueryPredicate other = (MatchQueryPredicate ) obj ;
100- return Objects .equals (field , other .field ) && Objects . equals ( boost , other . boost ) && Objects . equals ( fuzziness , other . fuzziness ) ;
65+ return Objects .equals (field , other .field );
10166 }
10267 return false ;
10368 }
10469
105- public Double boost () {
106- return boost ;
107- }
108-
109- public Fuzziness fuzziness () {
110- return fuzziness ;
70+ @ Override
71+ public String getWriteableName () {
72+ return ENTRY .name ;
11173 }
11274}
0 commit comments