88import io .qdrant .client .grpc .Points .Document ;
99import io .qdrant .client .grpc .Points .Formula ;
1010import io .qdrant .client .grpc .Points .Fusion ;
11+ import io .qdrant .client .grpc .Points .Image ;
1112import io .qdrant .client .grpc .Points .InferenceObject ;
13+ import io .qdrant .client .grpc .Points .Mmr ;
14+ import io .qdrant .client .grpc .Points .NearestInputWithMmr ;
1215import io .qdrant .client .grpc .Points .OrderBy ;
1316import io .qdrant .client .grpc .Points .PointId ;
1417import io .qdrant .client .grpc .Points .Query ;
@@ -192,7 +195,7 @@ public static Query nearest(Document document) {
192195 * @param image The image to vectorize and query against.
193196 * @return a new instance of {@link Query}
194197 */
195- public static Query nearest (io . qdrant . client . grpc . Points . Image image ) {
198+ public static Query nearest (Image image ) {
196199 return Query .newBuilder ().setNearest (vectorInput (image )).build ();
197200 }
198201
@@ -206,6 +209,19 @@ public static Query nearest(InferenceObject object) {
206209 return Query .newBuilder ().setNearest (vectorInput (object )).build ();
207210 }
208211
212+ /**
213+ * Creates a {@link Query} for re-ranking points with MMR (Maximum Marginal Relevance).
214+ *
215+ * @param nearest The vector input for nearest search.
216+ * @param mmr The MMR configuration.
217+ * @return a new instance of {@link Query}
218+ */
219+ public static Query nearest (VectorInput nearest , Mmr mmr ) {
220+ return Query .newBuilder ()
221+ .setNearestWithMmr (NearestInputWithMmr .newBuilder ().setNearest (nearest ).setMmr (mmr ).build ())
222+ .build ();
223+ }
224+
209225 /**
210226 * Creates a {@link Query} from a nested list of floats representing a multi vector
211227 *
0 commit comments