@@ -931,12 +931,12 @@ object ElasticQuery {
931931 * the type-safe field for which query is specified for
932932 * @param values
933933 * a list of terms that should be find in the provided field
934- * @tparam S
935- * document for which field query is executed
936934 * @tparam A
937935 * the type of value to be matched. A JSON decoder must be provided in the scope for this type
936+ * @tparam S
937+ * document for which field query is executed
938938 * @return
939- * an instance of [[zio.elasticsearch.query.TermsQuery ]] that represents the term query to be performed.
939+ * an instance of [[zio.elasticsearch.query.TermsQuery ]] that represents the terms query to be performed.
940940 */
941941 final def terms [S , A : ElasticPrimitive ](field : Field [S , A ], values : A * ): TermsQuery [S ] =
942942 Terms (field = field.toString, values = Chunk .fromIterable(values), boost = None )
@@ -954,11 +954,135 @@ object ElasticQuery {
954954 * @tparam A
955955 * the type of value to be matched. A JSON decoder must be provided in the scope for this type
956956 * @return
957- * an instance of [[zio.elasticsearch.query.TermsQuery ]] that represents the term query to be performed.
957+ * an instance of [[zio.elasticsearch.query.TermsQuery ]] that represents the terms query to be performed.
958958 */
959959 final def terms [A : ElasticPrimitive ](field : String , values : A * ): TermsQuery [Any ] =
960960 Terms (field = field, values = Chunk .fromIterable(values), boost = None )
961961
962+ /**
963+ * Constructs a type-safe instance of [[zio.elasticsearch.query.TermsSetQuery ]] using the specified parameters.
964+ * [[zio.elasticsearch.query.TermsSetQuery ]] is used for matching documents that contain the minimum amount of exact
965+ * terms in a provided field. The terms set query is the same as [[zio.elasticsearch.query.TermsQuery ]], except you
966+ * can define the number of matching terms required to return a document.
967+ *
968+ * @param field
969+ * the type-safe field for which query is specified for
970+ * @param terms
971+ * a list of terms that should be find in the provided field
972+ * @param minimumShouldMatchField
973+ * the type-safe field representing the number of matching terms required to return a document
974+ * @tparam A
975+ * the type of value to be matched. A JSON decoder must be provided in the scope for this type
976+ * @tparam S
977+ * document for which field query is executed
978+ * @return
979+ * an instance of [[zio.elasticsearch.query.TermsSetQuery ]] that represents the terms set query to be performed.
980+ */
981+ final def termsSet [S , A : ElasticPrimitive ](
982+ field : Field [S , A ],
983+ minimumShouldMatchField : Field [S , _],
984+ terms : A *
985+ ): TermsSetQuery [S ] =
986+ TermsSet (
987+ field = field.toString,
988+ terms = Chunk .fromIterable(terms),
989+ boost = None ,
990+ minimumShouldMatchField = Some (minimumShouldMatchField.toString),
991+ minimumShouldMatchScript = None
992+ )
993+
994+ /**
995+ * Constructs an instance of [[zio.elasticsearch.query.TermsSetQuery ]] using the specified parameters.
996+ * [[zio.elasticsearch.query.TermsSetQuery ]] is used for matching documents that contain the minimum amount of exact
997+ * terms in a provided field. The terms set query is the same as [[zio.elasticsearch.query.TermsQuery ]], except you
998+ * can define the number of matching terms required to return a document.
999+ *
1000+ * @param field
1001+ * the field for which query is specified for
1002+ * @param terms
1003+ * a list of terms that should be find in the provided field
1004+ * @param minimumShouldMatchField
1005+ * the number of matching terms required to return a document
1006+ * @tparam A
1007+ * the type of value to be matched. A JSON decoder must be provided in the scope for this type
1008+ * @return
1009+ * an instance of [[zio.elasticsearch.query.TermsSetQuery ]] that represents the terms set query to be performed.
1010+ */
1011+ final def termsSet [A : ElasticPrimitive ](
1012+ field : String ,
1013+ minimumShouldMatchField : String ,
1014+ terms : A *
1015+ ): TermsSetQuery [Any ] =
1016+ TermsSet (
1017+ field = field,
1018+ terms = Chunk .fromIterable(terms),
1019+ boost = None ,
1020+ minimumShouldMatchField = Some (minimumShouldMatchField),
1021+ minimumShouldMatchScript = None
1022+ )
1023+
1024+ /**
1025+ * Constructs a type-safe instance of [[zio.elasticsearch.query.TermsSetQuery ]] using the specified parameters.
1026+ * [[zio.elasticsearch.query.TermsSetQuery ]] is used for matching documents that contain the minimum amount of exact
1027+ * terms in a provided field. The terms set query is the same as [[zio.elasticsearch.query.TermsQuery ]], except you
1028+ * can define the number of matching terms required to return a document.
1029+ *
1030+ * @param field
1031+ * the type-safe field for which query is specified for
1032+ * @param terms
1033+ * a list of terms that should be find in the provided field
1034+ * @param minimumShouldMatchScript
1035+ * custom script containing the number of matching terms required to return a document
1036+ * @tparam A
1037+ * the type of value to be matched. A JSON decoder must be provided in the scope for this type
1038+ * @tparam S
1039+ * document for which field query is executed
1040+ * @return
1041+ * an instance of [[zio.elasticsearch.query.TermsSetQuery ]] that represents the terms set query to be performed.
1042+ */
1043+ final def termsSetScript [S , A : ElasticPrimitive ](
1044+ field : Field [S , A ],
1045+ minimumShouldMatchScript : Script ,
1046+ terms : A *
1047+ ): TermsSetQuery [S ] =
1048+ TermsSet (
1049+ field = field.toString,
1050+ terms = Chunk .fromIterable(terms),
1051+ boost = None ,
1052+ minimumShouldMatchField = None ,
1053+ minimumShouldMatchScript = Some (minimumShouldMatchScript)
1054+ )
1055+
1056+ /**
1057+ * Constructs an instance of [[zio.elasticsearch.query.TermsSetQuery ]] using the specified parameters.
1058+ * [[zio.elasticsearch.query.TermsSetQuery ]] is used for matching documents that contain the minimum amount of exact
1059+ * terms in a provided field. The terms set query is the same as [[zio.elasticsearch.query.TermsQuery ]], except you
1060+ * can define the number of matching terms required to return a document.
1061+ *
1062+ * @param field
1063+ * the field for which query is specified for
1064+ * @param terms
1065+ * a list of terms that should be find in the provided field
1066+ * @param minimumShouldMatchScript
1067+ * custom script containing the number of matching terms required to return a document
1068+ * @tparam A
1069+ * the type of value to be matched. A JSON decoder must be provided in the scope for this type
1070+ * @return
1071+ * an instance of [[zio.elasticsearch.query.TermsSetQuery ]] that represents the terms set query to be performed.
1072+ */
1073+ final def termsSetScript [A : ElasticPrimitive ](
1074+ field : String ,
1075+ minimumShouldMatchScript : Script ,
1076+ terms : A *
1077+ ): TermsSetQuery [Any ] =
1078+ TermsSet (
1079+ field = field,
1080+ terms = Chunk .fromIterable(terms),
1081+ boost = None ,
1082+ minimumShouldMatchField = None ,
1083+ minimumShouldMatchScript = Some (minimumShouldMatchScript)
1084+ )
1085+
9621086 /**
9631087 * Constructs a type-safe instance of [[zio.elasticsearch.query.WildcardQuery ]] using the specified parameters.
9641088 * [[zio.elasticsearch.query.WildcardQuery ]] is used for matching documents containing a value that matches a provided
0 commit comments