11package io .weaviate .client6 .v1 .api .collections .query ;
22
3+ import java .util .Arrays ;
34import java .util .List ;
45import java .util .Optional ;
56import java .util .function .Function ;
@@ -548,7 +549,7 @@ public GroupedResponseT nearObject(NearObject query, GroupBy groupBy) {
548549 * error status code.
549550 */
550551 public ResponseT nearText (String ... text ) {
551- return nearText (NearText . of ( text ));
552+ return nearText (Target . text ( Arrays . asList ( text ) ));
552553 }
553554
554555 /**
@@ -560,7 +561,7 @@ public ResponseT nearText(String... text) {
560561 * error status code.
561562 */
562563 public ResponseT nearText (String text , Function <NearText .Builder , ObjectBuilder <NearText >> fn ) {
563- return nearText (NearText . of (text , fn ) );
564+ return nearText (Target . text ( List . of (text )) , fn );
564565 }
565566
566567 /**
@@ -572,7 +573,30 @@ public ResponseT nearText(String text, Function<NearText.Builder, ObjectBuilder<
572573 * error status code.
573574 */
574575 public ResponseT nearText (List <String > text , Function <NearText .Builder , ObjectBuilder <NearText >> fn ) {
575- return nearText (NearText .of (text , fn ));
576+ return nearText (Target .text (text ), fn );
577+ }
578+
579+ /**
580+ * Query collection objects using near text search.
581+ *
582+ * @param searchTarget Target query concepts.
583+ * @throws WeaviateApiException in case the server returned with an
584+ * error status code.
585+ */
586+ public ResponseT nearText (Target searchTarget ) {
587+ return nearText (NearText .of (searchTarget ));
588+ }
589+
590+ /**
591+ * Query collection objects using near text search.
592+ *
593+ * @param searchTarget Target query concepts.
594+ * @param fn Lambda expression for optional parameters.
595+ * @throws WeaviateApiException in case the server returned with an
596+ * error status code.
597+ */
598+ public ResponseT nearText (Target searchTarget , Function <NearText .Builder , ObjectBuilder <NearText >> fn ) {
599+ return nearText (NearText .of (searchTarget , fn ));
576600 }
577601
578602 /**
@@ -599,7 +623,7 @@ public ResponseT nearText(NearText query) {
599623 * @see QueryResponseGrouped
600624 */
601625 public GroupedResponseT nearText (String text , GroupBy groupBy ) {
602- return nearText (NearText . of (text ), groupBy );
626+ return nearText (Target . text ( List . of (text ) ), groupBy );
603627 }
604628
605629 /**
@@ -615,7 +639,7 @@ public GroupedResponseT nearText(String text, GroupBy groupBy) {
615639 * @see QueryResponseGrouped
616640 */
617641 public GroupedResponseT nearText (List <String > text , GroupBy groupBy ) {
618- return nearText (NearText . of (text ), groupBy );
642+ return nearText (Target . text (text ), groupBy );
619643 }
620644
621645 /**
@@ -631,9 +655,10 @@ public GroupedResponseT nearText(List<String> text, GroupBy groupBy) {
631655 * @see GroupBy
632656 * @see QueryResponseGrouped
633657 */
634- public GroupedResponseT nearText (String text , Function <NearText .Builder , ObjectBuilder <NearText >> fn ,
658+ public GroupedResponseT nearText (String text ,
659+ Function <NearText .Builder , ObjectBuilder <NearText >> fn ,
635660 GroupBy groupBy ) {
636- return nearText (NearText . of (text ), groupBy );
661+ return nearText (Target . text ( List . of (text )), fn , groupBy );
637662 }
638663
639664 /**
@@ -649,9 +674,45 @@ public GroupedResponseT nearText(String text, Function<NearText.Builder, ObjectB
649674 * @see GroupBy
650675 * @see QueryResponseGrouped
651676 */
652- public GroupedResponseT nearText (List <String > text , Function <NearText .Builder , ObjectBuilder <NearText >> fn ,
677+ public GroupedResponseT nearText (List <String > text ,
678+ Function <NearText .Builder , ObjectBuilder <NearText >> fn ,
679+ GroupBy groupBy ) {
680+ return nearText (Target .text (text ), groupBy );
681+ }
682+
683+ /**
684+ * Query collection objects using near text search.
685+ *
686+ * @param searchTarget Target query concepts.
687+ * @param groupBy Group-by clause.
688+ * @return Grouped query result.
689+ * @throws WeaviateApiException in case the server returned with an
690+ * error status code.
691+ *
692+ * @see GroupBy
693+ * @see QueryResponseGrouped
694+ */
695+ public GroupedResponseT nearText (Target searchTarget , GroupBy groupBy ) {
696+ return nearText (NearText .of (searchTarget ), groupBy );
697+ }
698+
699+ /**
700+ * Query collection objects using near text search.
701+ *
702+ * @param searchTarget Target query concepts.
703+ * @param fn Lambda expression for optional parameters.
704+ * @param groupBy Group-by clause.
705+ * @return Grouped query result.
706+ * @throws WeaviateApiException in case the server returned with an
707+ * error status code.
708+ *
709+ * @see GroupBy
710+ * @see QueryResponseGrouped
711+ */
712+ public GroupedResponseT nearText (Target searchTarget ,
713+ Function <NearText .Builder , ObjectBuilder <NearText >> fn ,
653714 GroupBy groupBy ) {
654- return nearText (NearText .of (text ), groupBy );
715+ return nearText (NearText .of (searchTarget , fn ), groupBy );
655716 }
656717
657718 /**
0 commit comments