@@ -173,6 +173,20 @@ public enum QueryClause {
173173 NUMERIC_BETWEEN ( //
174174 QueryClauseTemplate .of (FieldType .NUMERIC , Part .Type .BETWEEN , QueryClause .FIELD_NUMERIC_BETWEEN , 2 ) //
175175 ),
176+ /**
177+ * Numeric field query clause for range matching.
178+ * Matches numeric fields that are equal to any of the specified values.
179+ */
180+ NUMERIC_IN ( //
181+ QueryClauseTemplate .of (FieldType .NUMERIC , Part .Type .IN , QueryClause .FIELD_EQUAL , 1 ) //
182+ ),
183+ /**
184+ * Numeric field query clause for negated membership testing.
185+ * Matches numeric fields that are not equal to any of the specified values.
186+ */
187+ NUMERIC_NOT_IN ( //
188+ QueryClauseTemplate .of (FieldType .NUMERIC , Part .Type .NOT_IN , QueryClause .FIELD_EQUAL , 1 ) //
189+ ),
176190 /**
177191 * Numeric field query clause for "less than" comparisons.
178192 * Matches numeric fields whose values are less than the specified value.
@@ -569,31 +583,40 @@ public String prepareQuery(String field, Object... params) {
569583 if (this == QueryClause .TAG_CONTAINING_ALL ) {
570584 value = c .stream ().map (n -> "@" + field + ":{" + QueryUtils .escape (ObjectUtils .asString (n ,
571585 converter )) + "}" ).collect (Collectors .joining (" " ));
586+ prepared = prepared .replace (PARAM_PREFIX + i ++, value );
572587 } else if (this == QueryClause .NUMERIC_CONTAINING ) {
573588 value = c .stream ().map (n -> "@" + field + ":[" + QueryUtils .escape (ObjectUtils .asString (n ,
574589 converter )) + " " + QueryUtils .escape (ObjectUtils .asString (n , converter )) + "]" ).collect (Collectors
575590 .joining ("|" ));
591+ prepared = prepared .replace (PARAM_PREFIX + i ++, value );
592+ } else if (this == QueryClause .NUMERIC_IN ) {
593+ value = c .stream ().map (n -> "@" + field + ":[" + QueryUtils .escape (ObjectUtils .asString (n ,
594+ converter )) + " " + QueryUtils .escape (ObjectUtils .asString (n , converter )) + "]" ).collect (Collectors
595+ .joining ("|" ));
596+ prepared = value ;
576597 } else if (this == QueryClause .NUMERIC_CONTAINING_ALL ) {
577598 value = c .stream ().map (n -> "@" + field + ":[" + QueryUtils .escape (ObjectUtils .asString (n ,
578599 converter )) + " " + QueryUtils .escape (ObjectUtils .asString (n , converter )) + "]" ).collect (Collectors
579600 .joining (" " ));
601+ prepared = prepared .replace (PARAM_PREFIX + i ++, value );
580602 } else if (this == QueryClause .GEO_CONTAINING ) {
581603 value = c .stream ().map (n -> {
582604 Point p = (Point ) n ;
583605 return "@" + field + ":[" + p .getX () + " " + p .getY () + " .000001 ft]" ;
584606 }).collect (Collectors .joining ("|" ));
607+ prepared = prepared .replace (PARAM_PREFIX + i ++, value );
585608 } else if (this == QueryClause .GEO_CONTAINING_ALL ) {
586609 value = c .stream ().map (n -> {
587610 Point p = (Point ) n ;
588611 return "@" + field + ":[" + p .getX () + " " + p .getY () + " .000001 ft]" ;
589612 }).collect (Collectors .joining (" " ));
613+ prepared = prepared .replace (PARAM_PREFIX + i ++, value );
590614 } else {
591615 value = c .stream ()//
592616 .map (n -> QueryUtils .escape (ObjectUtils .asString (n , converter ), false )).collect (Collectors .joining (
593617 "|" ));
618+ prepared = prepared .replace (PARAM_PREFIX + i ++, value );
594619 }
595-
596- prepared = prepared .replace (PARAM_PREFIX + i ++, value );
597620 } else {
598621 if (clauseTemplate .getIndexType () == FieldType .TEXT ) {
599622 prepared = prepared .replace (PARAM_PREFIX + i ++, param .toString ());
0 commit comments