paginate(
* collection exceeds {@link Long#MAX_VALUE} as this is unlikely to happen.
*
*
- * This is a shortcut for:
+ * This is a shorthand for:
*
*
{@code
* handle.aggregate.overAll(all -> all.includeTotalCount(true)).totalCount()
@@ -78,22 +107,30 @@ public long size() {
return this.aggregate.overAll(all -> all.includeTotalCount(true)).totalCount();
}
+ /** Default consistency level for requests. */
public ConsistencyLevel consistencyLevel() {
return defaults.consistencyLevel();
}
+ /** Obtain a collection handle with a different consistency level. */
public CollectionHandle withConsistencyLevel(ConsistencyLevel consistencyLevel) {
return new CollectionHandle<>(this, CollectionHandleDefaults.of(with -> with.consistencyLevel(consistencyLevel)));
}
+ /** Default tenant for requests. */
public String tenant() {
return defaults.tenant();
}
+ /** Obtain a collection handle with a different target tenant. */
public CollectionHandle withTenant(String tenant) {
return new CollectionHandle<>(this, CollectionHandleDefaults.of(with -> with.tenant(tenant)));
}
+ /**
+ * Obtain a collection handle with different defaults
+ * (consistency level / tenant).
+ */
public CollectionHandle withDefaults(
Function> fn) {
return new CollectionHandle<>(this, CollectionHandleDefaults.of(fn));
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleAsync.java b/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleAsync.java
index 1fdb73a35..5e8196dd2 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleAsync.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleAsync.java
@@ -85,23 +85,31 @@ public CompletableFuture size() {
.thenApply(AggregateResponse::totalCount);
}
+ /** Default consistency level for requests. */
public ConsistencyLevel consistencyLevel() {
return defaults.consistencyLevel();
}
+ /** Obtain a collection handle with a different consistency level. */
public CollectionHandleAsync withConsistencyLevel(ConsistencyLevel consistencyLevel) {
return new CollectionHandleAsync<>(this, CollectionHandleDefaults.of(
def -> def.consistencyLevel(consistencyLevel)));
}
+ /** Default tenant for requests. */
public String tenant() {
return defaults.tenant();
}
+ /** Obtain a collection handle with a different target tenant. */
public CollectionHandleAsync withTenant(String tenant) {
return new CollectionHandleAsync<>(this, CollectionHandleDefaults.of(with -> with.tenant(tenant)));
}
+ /**
+ * Obtain a collection handle with different defaults
+ * (consistency level / tenant).
+ */
public CollectionHandleAsync withDefaults(
Function> fn) {
return new CollectionHandleAsync<>(this, CollectionHandleDefaults.of(fn));
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaults.java b/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaults.java
index 7ce9711ba..c7952222a 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaults.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaults.java
@@ -54,6 +54,7 @@ public CollectionHandleDefaults build() {
}
}
+ /** Serialize default values to a URL query. */
public Map queryParameters() {
if (consistencyLevel == null && tenant == null) {
return Collections.emptyMap();
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/DataType.java b/src/main/java/io/weaviate/client6/v1/api/collections/DataType.java
index 32858bca6..91584a797 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/DataType.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/DataType.java
@@ -19,6 +19,17 @@ public interface DataType {
public static final String UUID = "uuid";
public static final String UUID_ARRAY = "uuid[]";
+ /**
+ * Scalar/array types which Weaviate and WeaviateClient recognize.
+ *
+ *
+ * Other data types are considered reference types, i.e. if a user creates a
+ * property with type {@code "timestamp"}, the client will count it a
+ * cross-reference to the {@code "timestamp"} collection.
+ *
+ * This is obviously wrong, so it is recommended to always create properties
+ * using {@link Property}'s factory classes.
+ */
public static final Set KNOWN_TYPES = ImmutableSet.of(
TEXT, INT, BLOB, BOOL, DATE, UUID, NUMBER,
TEXT_ARRAY, INT_ARRAY, NUMBER_ARRAY, BOOL_ARRAY, DATE_ARRAY, UUID_ARRAY);
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/Generative.java b/src/main/java/io/weaviate/client6/v1/api/collections/Generative.java
index 2354d5b7a..632713cdd 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/Generative.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/Generative.java
@@ -42,10 +42,16 @@ public static Kind valueOfJson(String jsonValue) {
Object _self();
+ /** Configure a default Cohere generative module. */
public static Generative cohere() {
return CohereGenerative.of();
}
+ /**
+ * Configure a Cohere generative module.
+ *
+ * @param fn Lambda expression for optional parameters.
+ */
public static Generative cohere(Function> fn) {
return CohereGenerative.of(fn);
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/InvertedIndex.java b/src/main/java/io/weaviate/client6/v1/api/collections/InvertedIndex.java
index 2edb99043..ad2fc17f6 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/InvertedIndex.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/InvertedIndex.java
@@ -9,12 +9,28 @@
import io.weaviate.client6.v1.internal.ObjectBuilder;
public record InvertedIndex(
+ /** The frequency of cleanup operations in the HNSW vector index. */
@SerializedName("cleanupIntervalSeconds") Integer cleanupIntervalSeconds,
+ /** Parameters for BM25 ranking algorithm. */
@SerializedName("bm25") Bm25 bm25,
+ /** Common words which should be ignored in queries. */
@SerializedName("stopwords") Stopwords stopwords,
+ /**
+ * If true, indexes object creation and update timestamps,
+ * enabling filtering by creationTimeUnix and lastUpdateTimeUnix.
+ */
@SerializedName("indexTimestamps") Boolean indexTimestamps,
+ /**
+ * If true, indexes the null/non-null state of each property,
+ * enabling filtering for null values.
+ */
@SerializedName("indexNullState") Boolean indexNulls,
+ /**
+ * If true, indexes the length of each property,
+ * enabling filtering by property length.
+ */
@SerializedName("indexPropertyLength") Boolean indexPropertyLength,
+ /** If true, BlockMaxWAND optimization is used. */
@SerializedName("usingBlockMaxWAND") Boolean useBlockMaxWAND) {
public static InvertedIndex of(Function> fn) {
@@ -22,7 +38,9 @@ public static InvertedIndex of(Function> f
}
public record Bm25(
+ /** Free parameter for the BM25 ranking function. */
@SerializedName("b") Float b,
+ /** Free parameter for the BM25 ranking function. */
@SerializedName("k1") Float k1) {
public static Bm25 of(Function> fn) {
@@ -37,11 +55,13 @@ public static class Builder implements ObjectBuilder {
private Float b;
private Float k1;
+ /** Set free parameter {@code b} for the BM25 ranking function. */
public Builder b(float b) {
this.b = b;
return this;
}
+ /** Set free parameter {@code k1} for the BM25 ranking function. */
public Builder k1(float k1) {
this.k1 = k1;
return this;
@@ -55,8 +75,11 @@ public Bm25 build() {
}
public record Stopwords(
+ /** Selected preset. */
@SerializedName("preset") String preset,
+ /** Custom words added to the selected preset. */
@SerializedName("additions") List additions,
+ /** Words removed from the selected preset. */
@SerializedName("removals") List removals) {
public static Stopwords of(Function> fn) {
@@ -72,24 +95,29 @@ public static class Builder implements ObjectBuilder {
private List additions;
private List removals;
+ /** Select a preset to use for a particular language. */
public Builder preset(String preset) {
this.preset = preset;
return this;
}
+ /** Add words to the selected preset. */
public Builder add(String... additions) {
return add(Arrays.asList(additions));
}
+ /** Add words to the selected preset. */
public Builder add(List additions) {
this.additions.addAll(additions);
return this;
}
+ /** Remove words from the selected preset. */
public Builder remove(String... removals) {
return remove(Arrays.asList(removals));
}
+ /** Remove words from the selected preset. */
public Builder remove(List removals) {
this.removals.addAll(removals);
return this;
@@ -122,37 +150,59 @@ public static class Builder implements ObjectBuilder {
private Boolean indexPropertyLength;
private Boolean useBlockMaxWAND;
+ /** Set the frequency of cleanup operations in the HNSW vector index. */
public Builder cleanupIntervalSeconds(int cleanupIntervalSeconds) {
this.cleanupIntervalSeconds = cleanupIntervalSeconds;
return this;
}
+ /** Set {@code b} and {@code k1} parameters for BM25 ranking algorithm. */
public Builder bm25(Function> fn) {
this.bm25 = Bm25.of(fn);
return this;
}
+ /** Select and configure a stopwords preset. */
public Builder stopwords(Function> fn) {
this.stopwords = Stopwords.of(fn);
return this;
}
- public Builder indexTimestamps(Boolean indexTimestamps) {
+ /**
+ * Enable / disable creating an index for creation / update timestamps.
+ *
+ * @see InvertedIndex#indexTimestamps
+ */
+ public Builder indexTimestamps(boolean indexTimestamps) {
this.indexTimestamps = indexTimestamps;
return this;
}
- public Builder indexNulls(Boolean indexNulls) {
+ /**
+ * Enable / disable creating an index for null property values.
+ *
+ * @see InvertedIndex#indexNulls
+ */
+ public Builder indexNulls(boolean indexNulls) {
this.indexNulls = indexNulls;
return this;
}
- public Builder indexPropertyLength(Boolean indexPropertyLength) {
+ /**
+ * Enable / disable creating an index for property lengths.
+ *
+ * @see InvertedIndex#indexPropertyLength
+ */
+ public Builder indexPropertyLength(boolean indexPropertyLength) {
this.indexPropertyLength = indexPropertyLength;
return this;
}
- public Builder useBlockMaxWAND(Boolean useBlockMaxWAND) {
+ /**
+ * If true, indexes object creation and update timestamps,
+ * enabling filtering by creationTimeUnix and lastUpdateTimeUnix.
+ */
+ public Builder useBlockMaxWAND(boolean useBlockMaxWAND) {
this.useBlockMaxWAND = useBlockMaxWAND;
return this;
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/MultiTenancy.java b/src/main/java/io/weaviate/client6/v1/api/collections/MultiTenancy.java
index 9524a1f05..11227eeea 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/MultiTenancy.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/MultiTenancy.java
@@ -7,8 +7,11 @@
import io.weaviate.client6.v1.internal.ObjectBuilder;
public record MultiTenancy(
+ /** Is multi-tenancy enabled for this collection. */
@SerializedName("enabled") boolean enabled,
+ /** Is auto tenant creation enabled for this collection. */
@SerializedName("autoTenantCreation") Boolean createAutomatically,
+ /** Is auto tenant activation enabled for this collection. */
@SerializedName("autoTenantActivation") Boolean activateAutomatically) {
public static MultiTenancy of(Function> fn) {
@@ -27,16 +30,19 @@ public static class Builder implements ObjectBuilder {
private Boolean createAutomatically;
private Boolean activateAutomatically;
+ /** Enable / disable multi-tenancy for this collection. */
public Builder enabled(boolean enabled) {
this.enabled = enabled;
return this;
}
+ /** Enable / disable auto tenant creation. */
public Builder autoTenantCreation(boolean enabled) {
this.createAutomatically = enabled;
return this;
}
+ /** Enable / disable auto tenant activation. */
public Builder autoTenantActivation(boolean enabled) {
this.activateAutomatically = enabled;
return this;
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/Quantization.java b/src/main/java/io/weaviate/client6/v1/api/collections/Quantization.java
index 64c4ec022..b17b11441 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/Quantization.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/Quantization.java
@@ -51,38 +51,63 @@ public static Kind valueOfJson(String jsonValue) {
Object _self();
+ /** Disable any quantization for this collection. */
public static Quantization uncompressed() {
return Uncompressed.of();
}
+ /** Enable binary quantization for this collection. */
public static Quantization bq() {
return BQ.of();
}
+ /**
+ * Enable binary quantization for this collection.
+ *
+ * @param fn Lambda expression for optional parameters.
+ */
public static Quantization bq(Function> fn) {
return BQ.of(fn);
}
+ /** Enable product quantization for this collection. */
public static Quantization pq() {
return PQ.of();
}
+ /**
+ * Enable product quantization for this collection.
+ *
+ * @param fn Lambda expression for optional parameters.
+ */
public static Quantization pq(Function> fn) {
return PQ.of(fn);
}
+ /** Enable scalar quantization for this collection. */
public static Quantization sq() {
return SQ.of();
}
+ /**
+ * Enable scalar quantization for this collection.
+ *
+ * @param fn Lambda expression for optional parameters.
+ */
public static Quantization sq(Function> fn) {
return SQ.of(fn);
}
+ /** Enable rotational quantization for this collection. */
public static Quantization rq() {
return RQ.of();
}
+ /**
+ * Enable rotational quantization for this collection.
+ *
+ * @param fn Lambda expression for optional parameters.
+ */
public static Quantization rq(Function> fn) {
return RQ.of(fn);
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/ReferenceProperty.java b/src/main/java/io/weaviate/client6/v1/api/collections/ReferenceProperty.java
index 38716f782..7b3d37703 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/ReferenceProperty.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/ReferenceProperty.java
@@ -44,6 +44,7 @@ public static ReferenceProperty to(String name, List collections) {
return new ReferenceProperty(name, collections);
}
+ /** This method is intended for client's internal use only. */
public Property toProperty() {
return new Property.Builder(propertyName, dataTypes).build();
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/Replication.java b/src/main/java/io/weaviate/client6/v1/api/collections/Replication.java
index 2b175bae5..a01af272c 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/Replication.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/Replication.java
@@ -36,16 +36,22 @@ public static class Builder implements ObjectBuilder {
private Boolean asyncEnabled;
private DeletionStrategy deletionStrategy;
+ /** Set desired replication factor for this collection. */
public Builder replicationFactor(int replicationFactor) {
this.replicationFactor = replicationFactor;
return this;
}
+ /** Enable / disable async replication. */
public Builder asyncEnabled(boolean asyncEnabled) {
this.asyncEnabled = asyncEnabled;
return this;
}
+ /**
+ * Select the deletion strategy for resolving conflicts
+ * during async replication.
+ */
public Builder deletionStrategy(DeletionStrategy deletionStrategy) {
this.deletionStrategy = deletionStrategy;
return this;
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/Reranker.java b/src/main/java/io/weaviate/client6/v1/api/collections/Reranker.java
index fb473b40c..08b6aeb82 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/Reranker.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/Reranker.java
@@ -42,10 +42,16 @@ public static Kind valueOfJson(String jsonValue) {
Object _self();
+ /** Configure a default Cohere reranker module. */
public static Reranker cohere() {
return CohereReranker.of();
}
+ /**
+ * Configure a Cohere reranker module.
+ *
+ * @param fn Lambda expression for optional parameters.
+ */
public static Reranker cohere(Function> fn) {
return CohereReranker.of(fn);
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/VectorConfig.java b/src/main/java/io/weaviate/client6/v1/api/collections/VectorConfig.java
index 1e8cd96d5..ae13f70ce 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/VectorConfig.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/VectorConfig.java
@@ -52,8 +52,10 @@ public static Kind valueOfJson(String jsonValue) {
Object _self();
+ /** Get vector index configuration for this vector. */
VectorIndex vectorIndex();
+ /** Get quantization configuration for this vector. */
Quantization quantization();
/** Create a bring-your-own-vector vector index. */
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/VectorIndex.java b/src/main/java/io/weaviate/client6/v1/api/collections/VectorIndex.java
index 4da02656c..51096f639 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/VectorIndex.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/VectorIndex.java
@@ -45,10 +45,12 @@ public static Kind valueOfJson(String jsonValue) {
VectorIndex.Kind _kind();
+ /** Returns the on-the-wire name of the vector index type. */
default String type() {
return _kind().jsonValue();
}
+ /** Get the concrete vector index configuration object. */
Object config();
public static enum CustomTypeAdapterFactory implements TypeAdapterFactory {
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClient.java b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClient.java
index 2bcb3071d..b662dbd61 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClient.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClient.java
@@ -224,6 +224,20 @@ public void delete(String collectionName) throws IOException {
this.restTransport.performRequest(new DeleteCollectionRequest(collectionName), DeleteCollectionRequest._ENDPOINT);
}
+ /**
+ * Delete a Weaviate collection.
+ *
+ * @param cls Class that represents an object in the collection.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @throws IOException in case the request was not sent successfully
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
+ public void delete(Class extends Record> cls) throws IOException {
+ delete(CollectionDescriptor.ofClass(cls).collectionName());
+ }
+
/**
* Delete all collections in Weaviate.
*
@@ -252,4 +266,18 @@ public void deleteAll() throws IOException {
public boolean exists(String collectionName) throws IOException {
return getConfig(collectionName).isPresent();
}
+
+ /**
+ * Check if a collection with this name exists.
+ *
+ * @param cls Class that represents an object in the collection.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @throws IOException in case the request was not sent successfully
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
+ public boolean exists(Class extends Record> cls) throws IOException {
+ return exists(CollectionDescriptor.ofClass(cls).collectionName());
+ }
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClientAsync.java b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClientAsync.java
index e7e4755b3..8f5c3516c 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClientAsync.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClientAsync.java
@@ -173,6 +173,15 @@ public CompletableFuture delete(String collectionName) {
DeleteCollectionRequest._ENDPOINT);
}
+ /**
+ * Delete a Weaviate collection.
+ *
+ * @param cls Class that represents an object in the collection.
+ */
+ public CompletableFuture delete(Class extends Record> cls) {
+ return delete(CollectionDescriptor.ofClass(cls).collectionName());
+ }
+
/**
* Delete all collections in Weaviate.
*/
@@ -193,4 +202,13 @@ public CompletableFuture deleteAll() throws IOException {
public CompletableFuture exists(String collectionName) {
return getConfig(collectionName).thenApply(Optional::isPresent);
}
+
+ /**
+ * Check if a collection with this name exists.
+ *
+ * @param cls Class that represents an object in the collection.
+ */
+ public CompletableFuture exists(Class extends Record> cls) {
+ return exists(CollectionDescriptor.ofClass(cls).collectionName());
+ }
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateMetadata.java b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateMetadata.java
index 9121e33c3..a4b8cc05a 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateMetadata.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateMetadata.java
@@ -1,7 +1,9 @@
package io.weaviate.client6.v1.api.collections;
public interface WeaviateMetadata {
+ /** Object's UUID. */
String uuid();
+ /** Object's associated vector embeddings. */
Vectors vectors();
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateObject.java b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateObject.java
index c96b22916..3180cf2e7 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateObject.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateObject.java
@@ -43,20 +43,22 @@ public static WeaviateObject
of(
}
public WeaviateObject(Builder
builder) {
- this(builder.collection, builder.properties, builder.references, builder.metadata);
+ this(builder.collectionName, builder.properties, builder.references, builder.metadata);
}
public static class Builder
implements ObjectBuilder> {
- private String collection;
+ private String collectionName;
private P properties;
private Map> references = new HashMap<>();
private M metadata;
- public final Builder collection(String collection) {
- this.collection = collection;
+ /** Set the name of the collection his object belongs to. */
+ public final Builder
collection(String collectionName) {
+ this.collectionName = collectionName;
return this;
}
+ /** Add object properties. */
public final Builder
properties(P properties) {
this.properties = properties;
return this;
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/aggregate/AbstractAggregateClient.java b/src/main/java/io/weaviate/client6/v1/api/collections/aggregate/AbstractAggregateClient.java
index 6c6db167b..c082ff70a 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/aggregate/AbstractAggregateClient.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/aggregate/AbstractAggregateClient.java
@@ -3,6 +3,7 @@
import java.util.List;
import java.util.function.Function;
+import io.weaviate.client6.v1.api.WeaviateApiException;
import io.weaviate.client6.v1.api.collections.CollectionHandleDefaults;
import io.weaviate.client6.v1.api.collections.query.Hybrid;
import io.weaviate.client6.v1.api.collections.query.NearAudio;
@@ -44,39 +45,139 @@ abstract class AbstractAggregateClient {
// OverAll ------------------------------------------------------------------
+ /**
+ * Aggregate metrics over all objects in this collection.
+ *
+ * @param fn Lambda expression for optional parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT overAll(Function> fn) {
return performRequest(Aggregation.of(fn));
}
+ /**
+ * Aggregate metrics over all objects in this collection.
+ *
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT overAll(Function> fn, GroupBy groupBy) {
return performRequest(Aggregation.of(fn), groupBy);
}
// Hybrid -------------------------------------------------------------------
+ /**
+ * Aggregate results of a hybrid search query.
+ *
+ * @param query Query string.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT hybrid(String query, Function> fn) {
return hybrid(Hybrid.of(query), fn);
}
- public ResponseT hybrid(String query, Function> nv,
+ /**
+ * Aggregate results of a hybrid search query.
+ *
+ * @param query Query string.
+ * @param hybrid Lambda expression for optional hybrid search parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
+ public ResponseT hybrid(String query, Function> hybrid,
Function> fn) {
- return hybrid(Hybrid.of(query, nv), fn);
- }
-
+ return hybrid(Hybrid.of(query, hybrid), fn);
+ }
+
+ /**
+ * Aggregate results of a hybrid search query.
+ *
+ * @param filter Hybrid query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT hybrid(Hybrid filter, Function> fn) {
return performRequest(Aggregation.of(filter, fn));
}
+ /**
+ * Aggregate results of a hybrid search query.
+ *
+ * @param query Query string.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT hybrid(String query, Function> fn,
GroupBy groupBy) {
return hybrid(Hybrid.of(query), fn, groupBy);
}
- public GroupedResponseT hybrid(String query, Function> nv,
+ /**
+ * Aggregate results of a hybrid search query.
+ *
+ * @param query Query string.
+ * @param hybrid Lambda expression for optional hybrid search parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
+ public GroupedResponseT hybrid(String query, Function> hybrid,
Function> fn, GroupBy groupBy) {
- return hybrid(Hybrid.of(query, nv), fn, groupBy);
- }
-
+ return hybrid(Hybrid.of(query, hybrid), fn, groupBy);
+ }
+
+ /**
+ * Aggregate results of a hybrid search query.
+ *
+ * @param filter Hybrid query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT hybrid(Hybrid filter, Function> fn,
GroupBy groupBy) {
return performRequest(Aggregation.of(filter, fn), groupBy);
@@ -84,29 +185,106 @@ public GroupedResponseT hybrid(Hybrid filter, Function> fn) {
return nearVector(NearVector.of(vector), fn);
}
+ /**
+ * Aggregate results of a near vector query.
+ *
+ * @param vector Query vector.
+ * @param nv Lambda expression for optional near vector parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearVector(float[] vector, Function> nv,
Function> fn) {
return nearVector(NearVector.of(vector, nv), fn);
}
+ /**
+ * Aggregate results of a near vector query.
+ *
+ * @param filter Near vector query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearVector(NearVector filter, Function> fn) {
return performRequest(Aggregation.of(filter, fn));
}
+ /**
+ * Aggregate results of a near vector query.
+ *
+ * @param vector Query vector.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearVector(float[] vector, Function> fn,
GroupBy groupBy) {
return nearVector(NearVector.of(vector), fn, groupBy);
}
+ /**
+ * Aggregate results of a near vector query.
+ *
+ * @param vector Query vector.
+ * @param nv Lambda expression for optional near vector parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearVector(float[] vector, Function> nv,
Function> fn, GroupBy groupBy) {
return nearVector(NearVector.of(vector, nv), fn, groupBy);
}
+ /**
+ * Aggregate results of a near vector query.
+ *
+ * @param filter Near vector query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearVector(NearVector filter, Function> fn,
GroupBy groupBy) {
return performRequest(Aggregation.of(filter, fn), groupBy);
@@ -114,29 +292,106 @@ public GroupedResponseT nearVector(NearVector filter, Function> fn) {
return nearObject(NearObject.of(uuid), fn);
}
- public ResponseT nearObject(String uuid, Function> nv,
+ /**
+ * Aggregate results of a near object query.
+ *
+ * @param uuid Query object UUID.
+ * @param nobj Lambda expression for optional near object parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
+ public ResponseT nearObject(String uuid, Function> nobj,
Function> fn) {
- return nearObject(NearObject.of(uuid, nv), fn);
- }
-
+ return nearObject(NearObject.of(uuid, nobj), fn);
+ }
+
+ /**
+ * Aggregate results of a near object query.
+ *
+ * @param filter Near object query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearObject(NearObject filter, Function> fn) {
return performRequest(Aggregation.of(filter, fn));
}
+ /**
+ * Aggregate results of a near object query.
+ *
+ * @param uuid Query object UUID.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearObject(String uuid, Function> fn,
GroupBy groupBy) {
return nearObject(NearObject.of(uuid), fn, groupBy);
}
- public GroupedResponseT nearObject(String uuid, Function> nv,
+ /**
+ * Aggregate results of a near object query.
+ *
+ * @param uuid Query object UUID.
+ * @param nobj Lambda expression for optional near object parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
+ public GroupedResponseT nearObject(String uuid, Function> nobj,
Function> fn, GroupBy groupBy) {
- return nearObject(NearObject.of(uuid, nv), fn, groupBy);
- }
-
+ return nearObject(NearObject.of(uuid, nobj), fn, groupBy);
+ }
+
+ /**
+ * Aggregate results of a near object query.
+ *
+ * @param filter Near object query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearObject(NearObject filter, Function> fn,
GroupBy groupBy) {
return performRequest(Aggregation.of(filter, fn), groupBy);
@@ -144,48 +399,176 @@ public GroupedResponseT nearObject(NearObject filter, Function> fn) {
return nearText(NearText.of(text), fn);
}
+ /**
+ * Aggregate results of a near text query.
+ *
+ * @param concepts Query concepts.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearText(List concepts, Function> fn) {
return nearText(NearText.of(concepts), fn);
}
+ /**
+ * Aggregate results of a near text query.
+ *
+ * @param text Query string.
+ * @param nt Lambda expression for optional near text parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearText(String text, Function> nt,
Function> fn) {
return nearText(NearText.of(text, nt), fn);
}
+ /**
+ * Aggregate results of a near text query.
+ *
+ * @param concepts Query concepts.
+ * @param nt Lambda expression for optional near text parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearText(List concepts, Function> nt,
Function> fn) {
return nearText(NearText.of(concepts, nt), fn);
}
+ /**
+ * Aggregate results of a near text query.
+ *
+ * @param filter Near text query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearText(NearText filter, Function> fn) {
return performRequest(Aggregation.of(filter, fn));
}
+ /**
+ * Aggregate results of a near text query.
+ *
+ * @param text Query string.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearText(String text, Function> fn,
GroupBy groupBy) {
return nearText(NearText.of(text), fn, groupBy);
}
+ /**
+ * Aggregate results of a near text query.
+ *
+ * @param concepts Query concepts.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearText(List concepts, Function> fn,
GroupBy groupBy) {
return nearText(NearText.of(concepts), fn, groupBy);
}
+ /**
+ * Aggregate results of a near text query.
+ *
+ * @param text Query string.
+ * @param nt Lambda expression for optional near text parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearText(String text, Function> nt,
Function> fn, GroupBy groupBy) {
return nearText(NearText.of(text, nt), fn, groupBy);
}
+ /**
+ * Aggregate results of a near text query.
+ *
+ * @param concepts Query concepts.
+ * @param nt Lambda expression for optional near text parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearText(List concepts, Function> nt,
Function> fn, GroupBy groupBy) {
return nearText(NearText.of(concepts, nt), fn, groupBy);
}
+ /**
+ * Aggregate results of a near text query.
+ *
+ * @param filter Near text query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearText(NearText filter, Function> fn,
GroupBy groupBy) {
return performRequest(Aggregation.of(filter, fn), groupBy);
@@ -193,29 +576,106 @@ public GroupedResponseT nearText(NearText filter, Function> fn) {
return nearImage(NearImage.of(image), fn);
}
- public ResponseT nearImage(String image, Function> nv,
+ /**
+ * Aggregate results of a near image query.
+ *
+ * @param image Query image.
+ * @param ni Lambda expression for optional near image parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
+ public ResponseT nearImage(String image, Function> ni,
Function> fn) {
- return nearImage(NearImage.of(image, nv), fn);
- }
-
+ return nearImage(NearImage.of(image, ni), fn);
+ }
+
+ /**
+ * Aggregate results of a near image query.
+ *
+ * @param filter Near image query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearImage(NearImage filter, Function> fn) {
return performRequest(Aggregation.of(filter, fn));
}
+ /**
+ * Aggregate results of a near image query.
+ *
+ * @param image Query image.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearImage(String image, Function> fn,
GroupBy groupBy) {
return nearImage(NearImage.of(image), fn, groupBy);
}
- public GroupedResponseT nearImage(String image, Function> nv,
+ /**
+ * Aggregate results of a near image query.
+ *
+ * @param image Query image.
+ * @param ni Lambda expression for optional near image parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
+ public GroupedResponseT nearImage(String image, Function> ni,
Function> fn, GroupBy groupBy) {
- return nearImage(NearImage.of(image, nv), fn, groupBy);
- }
-
+ return nearImage(NearImage.of(image, ni), fn, groupBy);
+ }
+
+ /**
+ * Aggregate results of a near image query.
+ *
+ * @param filter Near image query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearImage(NearImage filter, Function> fn,
GroupBy groupBy) {
return performRequest(Aggregation.of(filter, fn), groupBy);
@@ -223,29 +683,106 @@ public GroupedResponseT nearImage(NearImage filter, Function> fn) {
return nearAudio(NearAudio.of(audio), fn);
}
- public ResponseT nearAudio(String audio, Function> nv,
+ /**
+ * Aggregate results of a near audio query.
+ *
+ * @param audio Query audio.
+ * @param na Lambda expression for optional near audio parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
+ public ResponseT nearAudio(String audio, Function> na,
Function> fn) {
- return nearAudio(NearAudio.of(audio, nv), fn);
- }
-
+ return nearAudio(NearAudio.of(audio, na), fn);
+ }
+
+ /**
+ * Aggregate results of a near audio query.
+ *
+ * @param filter Near audio query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearAudio(NearAudio filter, Function> fn) {
return performRequest(Aggregation.of(filter, fn));
}
+ /**
+ * Aggregate results of a near audio query.
+ *
+ * @param audio Query audio.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearAudio(String audio, Function> fn,
GroupBy groupBy) {
return nearAudio(NearAudio.of(audio), fn, groupBy);
}
- public GroupedResponseT nearAudio(String audio, Function> nv,
+ /**
+ * Aggregate results of a near audio query.
+ *
+ * @param audio Query audio.
+ * @param na Lambda expression for optional near audio parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
+ public GroupedResponseT nearAudio(String audio, Function> na,
Function> fn, GroupBy groupBy) {
- return nearAudio(NearAudio.of(audio, nv), fn, groupBy);
- }
-
+ return nearAudio(NearAudio.of(audio, na), fn, groupBy);
+ }
+
+ /**
+ * Aggregate results of a near audio query.
+ *
+ * @param filter Near audio query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearAudio(NearAudio filter, Function> fn,
GroupBy groupBy) {
return performRequest(Aggregation.of(filter, fn), groupBy);
@@ -253,29 +790,106 @@ public GroupedResponseT nearAudio(NearAudio filter, Function> fn) {
return nearVideo(NearVideo.of(video), fn);
}
+ /**
+ * Aggregate results of a near video query.
+ *
+ * @param video Query video.
+ * @param nv Lambda expression for optional near video parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearVideo(String video, Function> nv,
Function> fn) {
return nearVideo(NearVideo.of(video, nv), fn);
}
+ /**
+ * Aggregate results of a near video query.
+ *
+ * @param filter Near video query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearVideo(NearVideo filter, Function> fn) {
return performRequest(Aggregation.of(filter, fn));
}
+ /**
+ * Aggregate results of a near video query.
+ *
+ * @param video Query video.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearVideo(String video, Function> fn,
GroupBy groupBy) {
return nearVideo(NearVideo.of(video), fn, groupBy);
}
+ /**
+ * Aggregate results of a near video query.
+ *
+ * @param video Query video.
+ * @param nv Lambda expression for optional near video parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearVideo(String video, Function> nv,
Function> fn, GroupBy groupBy) {
return nearVideo(NearVideo.of(video, nv), fn, groupBy);
}
+ /**
+ * Aggregate results of a near video query.
+ *
+ * @param filter Near video query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearVideo(NearVideo filter, Function> fn,
GroupBy groupBy) {
return performRequest(Aggregation.of(filter, fn), groupBy);
@@ -283,29 +897,106 @@ public GroupedResponseT nearVideo(NearVideo filter, Function> fn) {
return nearThermal(NearThermal.of(thermal), fn);
}
- public ResponseT nearThermal(String thermal, Function> nv,
+ /**
+ * Aggregate results of a near thermal query.
+ *
+ * @param thermal Query thermal.
+ * @param nt Lambda expression for optional near thermal parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
+ public ResponseT nearThermal(String thermal, Function> nt,
Function> fn) {
- return nearThermal(NearThermal.of(thermal, nv), fn);
- }
-
+ return nearThermal(NearThermal.of(thermal, nt), fn);
+ }
+
+ /**
+ * Aggregate results of a near thermal query.
+ *
+ * @param filter Near thermal query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearThermal(NearThermal filter, Function> fn) {
return performRequest(Aggregation.of(filter, fn));
}
+ /**
+ * Aggregate results of a near thermal query.
+ *
+ * @param thermal Query thermal.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearThermal(String thermal, Function> fn,
GroupBy groupBy) {
return nearThermal(NearThermal.of(thermal), fn, groupBy);
}
- public GroupedResponseT nearThermal(String thermal, Function> nv,
+ /**
+ * Aggregate results of a near thermal query.
+ *
+ * @param thermal Query thermal.
+ * @param nt Lambda expression for optional near thermal parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
+ public GroupedResponseT nearThermal(String thermal, Function> nt,
Function> fn, GroupBy groupBy) {
- return nearThermal(NearThermal.of(thermal, nv), fn, groupBy);
- }
-
+ return nearThermal(NearThermal.of(thermal, nt), fn, groupBy);
+ }
+
+ /**
+ * Aggregate results of a near thermal query.
+ *
+ * @param filter Near thermal query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearThermal(NearThermal filter, Function> fn,
GroupBy groupBy) {
return performRequest(Aggregation.of(filter, fn), groupBy);
@@ -313,29 +1004,106 @@ public GroupedResponseT nearThermal(NearThermal filter, Function> fn) {
return nearDepth(NearDepth.of(depth), fn);
}
- public ResponseT nearDepth(String depth, Function> nv,
+ /**
+ * Aggregate results of a near depth query.
+ *
+ * @param depth Query depth.
+ * @param nd Lambda expression for optional near depth parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
+ public ResponseT nearDepth(String depth, Function> nd,
Function> fn) {
- return nearDepth(NearDepth.of(depth, nv), fn);
- }
-
+ return nearDepth(NearDepth.of(depth, nd), fn);
+ }
+
+ /**
+ * Aggregate results of a near depth query.
+ *
+ * @param filter Near depth query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearDepth(NearDepth filter, Function> fn) {
return performRequest(Aggregation.of(filter, fn));
}
+ /**
+ * Aggregate results of a near depth query.
+ *
+ * @param depth Query depth.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearDepth(String depth, Function> fn,
GroupBy groupBy) {
return nearDepth(NearDepth.of(depth), fn, groupBy);
}
- public GroupedResponseT nearDepth(String depth, Function> nv,
+ /**
+ * Aggregate results of a near depth query.
+ *
+ * @param depth Query depth.
+ * @param nd Lambda expression for optional near depth parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
+ public GroupedResponseT nearDepth(String depth, Function> nd,
Function> fn, GroupBy groupBy) {
- return nearDepth(NearDepth.of(depth, nv), fn, groupBy);
- }
-
+ return nearDepth(NearDepth.of(depth, nd), fn, groupBy);
+ }
+
+ /**
+ * Aggregate results of a near depth query.
+ *
+ * @param filter Near depth query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearDepth(NearDepth filter, Function> fn,
GroupBy groupBy) {
return performRequest(Aggregation.of(filter, fn), groupBy);
@@ -343,29 +1111,106 @@ public GroupedResponseT nearDepth(NearDepth filter, Function> fn) {
return nearImu(NearImu.of(imu), fn);
}
- public ResponseT nearImu(String imu, Function> nv,
+ /**
+ * Aggregate results of a near IMU query.
+ *
+ * @param imu Query IMU.
+ * @param ni Lambda expression for optional near IMU parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
+ public ResponseT nearImu(String imu, Function> ni,
Function> fn) {
- return nearImu(NearImu.of(imu, nv), fn);
- }
-
+ return nearImu(NearImu.of(imu, ni), fn);
+ }
+
+ /**
+ * Aggregate results of a near IMU query.
+ *
+ * @param filter Near IMU query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @return Aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @see AggregateResponse
+ */
public ResponseT nearImu(NearImu filter, Function> fn) {
return performRequest(Aggregation.of(filter, fn));
}
+ /**
+ * Aggregate results of a near IMU query.
+ *
+ * @param imu Query IMU.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearImu(String imu, Function> fn,
GroupBy groupBy) {
return nearImu(NearImu.of(imu), fn, groupBy);
}
- public GroupedResponseT nearImu(String imu, Function> nv,
+ /**
+ * Aggregate results of a near IMU query.
+ *
+ * @param imu Query IMU.
+ * @param ni Lambda expression for optional near IMU parameters.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
+ public GroupedResponseT nearImu(String imu, Function> ni,
Function> fn, GroupBy groupBy) {
- return nearImu(NearImu.of(imu, nv), fn, groupBy);
- }
-
+ return nearImu(NearImu.of(imu, ni), fn, groupBy);
+ }
+
+ /**
+ * Aggregate results of a near IMU query.
+ *
+ * @param filter Near IMU query request.
+ * @param fn Lambda expression for optional aggregation parameters.
+ * @param groupBy GroupBy clause.
+ * @return Grouped aggregation result.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see AggregateResponseGrouped
+ */
public GroupedResponseT nearImu(NearImu filter, Function> fn,
GroupBy groupBy) {
return performRequest(Aggregation.of(filter, fn), groupBy);
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertManyRequest.java b/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertManyRequest.java
index c8a12fa0c..717b01c45 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertManyRequest.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertManyRequest.java
@@ -147,7 +147,7 @@ public static void buildObject(WeaviateProtoBatch.BatchObject.Builder object
protoValue.setBoolValue(v.booleanValue());
} else if (value instanceof Number v) {
protoValue.setNumberValue(v.doubleValue());
- } else if (value instanceof List v) {
+ } else if (value instanceof List> v) {
protoValue.setListValue(
com.google.protobuf.ListValue.newBuilder()
.addAllValues(v.stream()
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertObjectResponse.java b/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertObjectResponse.java
deleted file mode 100644
index c3eb95f2f..000000000
--- a/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertObjectResponse.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package io.weaviate.client6.v1.api.collections.data;
-
-import com.google.gson.annotations.SerializedName;
-
-import io.weaviate.client6.v1.api.collections.Vectors;
-
-public record InsertObjectResponse(
- @SerializedName("class") String collectionName,
- @SerializedName("properties") T properties,
- @SerializedName("id") String uuid,
- @SerializedName("vectors") Vectors vectors,
- @SerializedName("creationTimeUnix") Long createdAt,
- @SerializedName("lastUpdateTimeUnix") Long lastUpdatedAt) {
-}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/pagination/Paginator.java b/src/main/java/io/weaviate/client6/v1/api/collections/pagination/Paginator.java
index dfc7c90ca..7d7dcb6f9 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/pagination/Paginator.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/pagination/Paginator.java
@@ -74,6 +74,7 @@ public Builder(WeaviateQueryClient query) {
// Pagination options -----------------------------------------------------
+ /** Set a different page size. Defaults to 100. */
public Builder pageSize(int pageSize) {
this.pageSize = pageSize;
return this;
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/AbstractQueryClient.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/AbstractQueryClient.java
index 356df14d5..cc6492b38 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/AbstractQueryClient.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/AbstractQueryClient.java
@@ -4,6 +4,7 @@
import java.util.Optional;
import java.util.function.Function;
+import io.weaviate.client6.v1.api.WeaviateApiException;
import io.weaviate.client6.v1.api.collections.CollectionHandleDefaults;
import io.weaviate.client6.v1.api.collections.WeaviateObject;
import io.weaviate.client6.v1.internal.ObjectBuilder;
@@ -37,10 +38,28 @@ abstract class AbstractQueryClient> fn) {
// Collection handle defaults (consistencyLevel / tenant) are irrelevant for
// by-ID lookup. Do not `applyDefaults` to `fn`.
@@ -62,327 +81,1049 @@ protected final Optional> optionalF
// Object queries -----------------------------------------------------------
+ /**
+ * Retrieve objects without applying a Vector Search or Keyword Search filter.
+ *
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT fetchObjects(Function> fn) {
return fetchObjects(FetchObjects.of(fn));
}
+ /**
+ * Retrieve objects without applying a Vector Search or Keyword Search filter.
+ *
+ * @param query FetchObjects query.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT fetchObjects(FetchObjects query) {
return performRequest(query);
}
+ /**
+ * Retrieve objects without applying a Vector Search or Keyword Search filter.
+ *
+ *
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT fetchObjects(Function> fn,
GroupBy groupBy) {
return fetchObjects(FetchObjects.of(fn), groupBy);
}
+ /**
+ * Retrieve objects without applying a Vector Search or Keyword Search filter.
+ *
+ * @param query FetchObjects query.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT fetchObjects(FetchObjects query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// BM25 queries -------------------------------------------------------------
+ /**
+ * Query collection objects using keyword (BM25) search.
+ *
+ * @param query Query string.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT bm25(String query) {
return bm25(Bm25.of(query));
}
+ /**
+ * Query collection objects using keyword (BM25) search.
+ *
+ * @param query Query string.
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT bm25(String query, Function> fn) {
return bm25(Bm25.of(query, fn));
}
+ /**
+ * Query collection objects using keyword (BM25) search.
+ *
+ * @param query BM25 query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT bm25(Bm25 query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using keyword (BM25) search.
+ *
+ * @param query Query string.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT bm25(String query, GroupBy groupBy) {
return bm25(Bm25.of(query), groupBy);
}
+ /**
+ * Query collection objects using keyword (BM25) search.
+ *
+ * @param query Query string.
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT bm25(String query, Function> fn, GroupBy groupBy) {
return bm25(Bm25.of(query, fn), groupBy);
}
+ /**
+ * Query collection objects using keyword (BM25) search.
+ *
+ * @param query BM25 query request.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT bm25(Bm25 query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// Hybrid queries -----------------------------------------------------------
+ /**
+ * Query collection objects using hybrid search.
+ *
+ * @param query Query string.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT hybrid(String query) {
return hybrid(Hybrid.of(query));
}
+ /**
+ * Query collection objects using hybrid search.
+ *
+ * @param query Query string.
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT hybrid(String query, Function> fn) {
return hybrid(Hybrid.of(query, fn));
}
+ /**
+ * Query collection objects using hybrid search.
+ *
+ * @param query Hybrid query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT hybrid(Hybrid query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using hybrid search.
+ *
+ * @param query Query string.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT hybrid(String query, GroupBy groupBy) {
return hybrid(Hybrid.of(query), groupBy);
}
+ /**
+ * Query collection objects using hybrid search.
+ *
+ * @param query Query string.
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT hybrid(String query, Function> fn, GroupBy groupBy) {
return hybrid(Hybrid.of(query, fn), groupBy);
}
+ /**
+ * Query collection objects using hybrid search.
+ *
+ * @param query Query string.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT hybrid(Hybrid query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// NearVector queries -------------------------------------------------------
+ /**
+ * Query collection objects using near vector search.
+ *
+ * @param vector Query vector.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearVector(float[] vector) {
return nearVector(NearVector.of(vector));
}
+ /**
+ * Query collection objects using near vector search.
+ *
+ * @param vector Query vector.
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearVector(float[] vector, Function> fn) {
return nearVector(NearVector.of(vector, fn));
}
+ /**
+ * Query collection objects using near vector search.
+ *
+ * @param query Near vector query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearVector(NearVector query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using near vector search.
+ *
+ * @param vector Query vector.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearVector(float[] vector, GroupBy groupBy) {
return nearVector(NearVector.of(vector), groupBy);
}
+ /**
+ * Query collection objects using near vector search.
+ *
+ * @param vector Query vector.
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearVector(float[] vector, Function> fn,
GroupBy groupBy) {
return nearVector(NearVector.of(vector, fn), groupBy);
}
+ /**
+ * Query collection objects using near vector search.
+ *
+ * @param query Near vector query request.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearVector(NearVector query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// NearObject queries -------------------------------------------------------
+ /**
+ * Query collection objects using near object search.
+ *
+ * @param uuid Query object UUID.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearObject(String uuid) {
return nearObject(NearObject.of(uuid));
}
+ /**
+ * Query collection objects using near object search.
+ *
+ * @param uuid Query object UUID.
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearObject(String uuid, Function> fn) {
return nearObject(NearObject.of(uuid, fn));
}
+ /**
+ * Query collection objects using near object search.
+ *
+ * @param query Near object query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearObject(NearObject query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using near object search.
+ *
+ * @param uuid Query object UUID.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearObject(String uuid, GroupBy groupBy) {
return nearObject(NearObject.of(uuid), groupBy);
}
+ /**
+ * Query collection objects using near object search.
+ *
+ * @param uuid Query object UUID.
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearObject(String uuid, Function> fn,
GroupBy groupBy) {
return nearObject(NearObject.of(uuid, fn), groupBy);
}
+ /**
+ * Query collection objects using near object search.
+ *
+ * @param query Near object query request.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearObject(NearObject query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// NearText queries ---------------------------------------------------------
+ /**
+ * Query collection objects using near text search.
+ *
+ * @param text Query concepts.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearText(String... text) {
return nearText(NearText.of(text));
}
+ /**
+ * Query collection objects using near text search.
+ *
+ * @param text Query concepts.
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearText(String text, Function> fn) {
return nearText(NearText.of(text, fn));
}
+ /**
+ * Query collection objects using near text search.
+ *
+ * @param text Query concepts.
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearText(List text, Function> fn) {
return nearText(NearText.of(text, fn));
}
+ /**
+ * Query collection objects using near text search.
+ *
+ * @param query Near text query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearText(NearText query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using near text search.
+ *
+ * @param text Query concepts.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearText(String text, GroupBy groupBy) {
return nearText(NearText.of(text), groupBy);
}
+ /**
+ * Query collection objects using near text search.
+ *
+ * @param text Query concepts.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearText(List text, GroupBy groupBy) {
return nearText(NearText.of(text), groupBy);
}
+ /**
+ * Query collection objects using near text search.
+ *
+ * @param text Query concepts.
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearText(String text, Function> fn,
GroupBy groupBy) {
return nearText(NearText.of(text), groupBy);
}
+ /**
+ * Query collection objects using near text search.
+ *
+ * @param text Query concepts.
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearText(List text, Function> fn,
GroupBy groupBy) {
return nearText(NearText.of(text), groupBy);
}
+ /**
+ * Query collection objects using near text search.
+ *
+ * @param query Near text query request.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearText(NearText query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// NearImage queries --------------------------------------------------------
+ /**
+ * Query collection objects using near image search.
+ *
+ * @param image Query image (base64-encoded).
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearImage(String image) {
return nearImage(NearImage.of(image));
}
+ /**
+ * Query collection objects using near image search.
+ *
+ * @param image Query image (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearImage(String image, Function> fn) {
return nearImage(NearImage.of(image, fn));
}
+ /**
+ * Query collection objects using near image search.
+ *
+ * @param query Near image query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearImage(NearImage query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using near image search.
+ *
+ * @param image Query image (base64-encoded).
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public GroupedResponseT nearImage(String image, GroupBy groupBy) {
return nearImage(NearImage.of(image), groupBy);
}
+ /**
+ * Query collection objects using near image search.
+ *
+ * @param image Query image (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearImage(String image, Function> fn,
GroupBy groupBy) {
return nearImage(NearImage.of(image, fn), groupBy);
}
+ /**
+ * Query collection objects using near image search.
+ *
+ * @param query Near image query request.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearImage(NearImage query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// NearAudio queries --------------------------------------------------------
+ /**
+ * Query collection objects using near audio search.
+ *
+ * @param audio Query audio (base64-encoded).
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearAudio(String audio) {
return nearAudio(NearAudio.of(audio));
}
+ /**
+ * Query collection objects using near audio search.
+ *
+ * @param audio Query audio (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearAudio(String audio, Function> fn) {
return nearAudio(NearAudio.of(audio, fn));
}
+ /**
+ * Query collection objects using near audio search.
+ *
+ * @param query Near audio query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearAudio(NearAudio query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using near audio search.
+ *
+ * @param audio Query audio (base64-encoded).
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearAudio(String audio, GroupBy groupBy) {
return nearAudio(NearAudio.of(audio), groupBy);
}
+ /**
+ * Query collection objects using near audio search.
+ *
+ * @param audio Query audio (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
+
public GroupedResponseT nearAudio(String audio, Function> fn,
GroupBy groupBy) {
return nearAudio(NearAudio.of(audio, fn), groupBy);
}
+ /**
+ * Query collection objects using near audio search.
+ *
+ * @param query Near audio query request.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearAudio(NearAudio query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// NearVideo queries --------------------------------------------------------
+ /**
+ * Query collection objects using near video search.
+ *
+ * @param video Query video (base64-encoded).
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearVideo(String video) {
return nearVideo(NearVideo.of(video));
}
+ /**
+ * Query collection objects using near video search.
+ *
+ * @param video Query video (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearVideo(String video, Function> fn) {
return nearVideo(NearVideo.of(video, fn));
}
+ /**
+ * Query collection objects using near video search.
+ *
+ * @param query Near video query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearVideo(NearVideo query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using near video search.
+ *
+ * @param video Query video (base64-encoded).
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearVideo(String video, GroupBy groupBy) {
return nearVideo(NearVideo.of(video), groupBy);
}
+ /**
+ * Query collection objects using near video search.
+ *
+ * @param video Query video (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearVideo(String video, Function> fn,
GroupBy groupBy) {
return nearVideo(NearVideo.of(video, fn), groupBy);
}
+ /**
+ * Query collection objects using near video search.
+ *
+ * @param query Near video query request.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearVideo(NearVideo query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// NearThermal queries ------------------------------------------------------
+ /**
+ * Query collection objects using near thermal search.
+ *
+ * @param thermal Query thermal (base64-encoded).
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearThermal(String thermal) {
return nearThermal(NearThermal.of(thermal));
}
+ /**
+ * Query collection objects using near thermal search.
+ *
+ * @param thermal Query thermal (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearThermal(String thermal, Function> fn) {
return nearThermal(NearThermal.of(thermal, fn));
}
+ /**
+ * Query collection objects using near thermal search.
+ *
+ * @param query Near thermal query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearThermal(NearThermal query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using near thermal search.
+ *
+ * @param thermal Query thermal (base64-encoded).
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearThermal(String thermal, GroupBy groupBy) {
return nearThermal(NearThermal.of(thermal), groupBy);
}
+ /**
+ * Query collection objects using near thermal search.
+ *
+ * @param thermal Query thermal (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearThermal(String thermal, Function> fn,
GroupBy groupBy) {
return nearThermal(NearThermal.of(thermal, fn), groupBy);
}
+ /**
+ * Query collection objects using near thermal search.
+ *
+ * @param query Near thermal query request.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearThermal(NearThermal query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// NearDepth queries --------------------------------------------------------
+ /**
+ * Query collection objects using near depth search.
+ *
+ * @param depth Query depth (base64-encoded).
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearDepth(String depth) {
return nearDepth(NearDepth.of(depth));
}
+ /**
+ * Query collection objects using near depth search.
+ *
+ * @param depth Query depth (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearDepth(String depth, Function> fn) {
return nearDepth(NearDepth.of(depth, fn));
}
+ /**
+ * Query collection objects using near depth search.
+ *
+ * @param query Near depth query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearDepth(NearDepth query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using near depth search.
+ *
+ * @param depth Query depth (base64-encoded).
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearDepth(String depth, GroupBy groupBy) {
return nearDepth(NearDepth.of(depth), groupBy);
}
+ /**
+ * Query collection objects using near depth search.
+ *
+ * @param depth Query depth (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearDepth(String depth, Function> fn,
GroupBy groupBy) {
return nearDepth(NearDepth.of(depth, fn), groupBy);
}
+ /**
+ * Query collection objects using near depth search.
+ *
+ * @param query Near depth query request.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearDepth(NearDepth query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
// NearImu queries ----------------------------------------------------------
+ /**
+ * Query collection objects using near IMU search.
+ *
+ * @param imu Query IMU (base64-encoded).
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearImu(String imu) {
return nearImu(NearImu.of(imu));
}
+ /**
+ * Query collection objects using near IMU search.
+ *
+ * @param imu Query IMU (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearImu(String imu, Function> fn) {
return nearImu(NearImu.of(imu, fn));
}
+ /**
+ * Query collection objects using near IMU search.
+ *
+ * @param query Near IMU query request.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public ResponseT nearImu(NearImu query) {
return performRequest(query);
}
+ /**
+ * Query collection objects using near IMU search.
+ *
+ * @param imu Query IMU (base64-encoded).
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearImu(String imu, GroupBy groupBy) {
return nearImu(NearImu.of(imu), groupBy);
}
+ /**
+ * Query collection objects using near IMU search.
+ *
+ * @param imu Query IMU (base64-encoded).
+ * @param fn Lambda expression for optional parameters.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearImu(String imu, Function> fn,
GroupBy groupBy) {
return nearImu(NearImu.of(imu, fn), groupBy);
}
+ /**
+ * Query collection objects using near IMU search.
+ *
+ * @param query Near IMU query request.
+ * @param groupBy Group-by clause.
+ * @return Grouped query result.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ *
+ * @see GroupBy
+ * @see QueryResponseGrouped
+ */
public GroupedResponseT nearImu(NearImu query, GroupBy groupBy) {
return performRequest(query, groupBy);
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/BaseQueryOptions.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/BaseQueryOptions.java
index ad8d71b24..036ce1165 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/BaseQueryOptions.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/BaseQueryOptions.java
@@ -52,26 +52,51 @@ protected Builder() {
returnMetadata(MetadataField.UUID);
}
+ /**
+ * Limit the number of returned objects.
+ *
+ *
+ * Combine with {@link #offset(int)} to use offset-based pagination.
+ */
public final SELF limit(int limit) {
this.limit = limit;
return (SELF) this;
}
+ /**
+ * Skip the first N objects in the result set.
+ *
+ *
+ * Combine with {@link #limit(int)} to use offset-based pagination.
+ */
public final SELF offset(int offset) {
this.offset = offset;
return (SELF) this;
}
+ /**
+ * Discard results after an automatically calculated cutoff point.
+ *
+ * @param autocut The number of "groups" to keep.
+ * @see Documentation
+ */
public final SELF autocut(int autocut) {
this.autocut = autocut;
return (SELF) this;
}
+ /**
+ * Discard results before this object.
+ *
+ * @param after UUID of an object in this collection.
+ */
public final SELF after(String after) {
this.after = after;
return (SELF) this;
}
+ /** Set consitency level for query resolution. */
public final SELF consistencyLevel(ConsistencyLevel consistencyLevel) {
this.consistencyLevel = consistencyLevel;
return (SELF) this;
@@ -81,42 +106,52 @@ public final SELF consistencyLevel(ConsistencyLevel consistencyLevel) {
* Filter result set using traditional filtering operators: {@code eq},
* {@code gte}, {@code like}, etc.
* Subsequent calls to {@link #where} aggregate with an AND operator.
- *
- *
- * See: {@link Where}
*/
public final SELF where(Where where) {
this.where = this.where == null ? where : Where.and(this.where, where);
return (SELF) this;
}
+ /** Combine several conditions using with an AND operator. */
+ public final SELF where(Where... wheres) {
+ Arrays.stream(wheres).map(this::where);
+ return (SELF) this;
+ }
+
+ /** Select properties to include in the query result. */
public final SELF returnProperties(String... properties) {
return returnProperties(Arrays.asList(properties));
}
+ /** Select properties to include in the query result. */
public final SELF returnProperties(List properties) {
this.returnProperties.addAll(properties);
return (SELF) this;
}
+ /** Select cross-referenced objects to include in the query result. */
public final SELF returnReferences(QueryReference... references) {
return returnReferences(Arrays.asList(references));
}
+ /** Select cross-referenced objects to include in the query result. */
public final SELF returnReferences(List references) {
this.returnReferences.addAll(references);
return (SELF) this;
}
+ /** Select metadata to include in the query result. */
public final SELF returnMetadata(Metadata... metadata) {
return returnMetadata(Arrays.asList(metadata));
}
+ /** Select metadata to include in the query result. */
public final SELF returnMetadata(List metadata) {
this.returnMetadata.addAll(metadata);
return (SELF) this;
}
+ /** Include default vector. */
public final SELF includeVector() {
return returnMetadata(Metadata.VECTOR);
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/BaseVectorSearchBuilder.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/BaseVectorSearchBuilder.java
index 08b385a1a..afc96d338 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/BaseVectorSearchBuilder.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/BaseVectorSearchBuilder.java
@@ -7,12 +7,29 @@ abstract class BaseVectorSearchBuilder
+ * Use {@link Hybrid.Builder#maxVectorDistance(float)} if {@link NearVector} or
+ * {@link NearText} are used as a vector search component in hybrid search.
+ */
@SuppressWarnings("unchecked")
public SelfT distance(float distance) {
this.distance = distance;
return (SelfT) this;
}
+ /**
+ * Discard objects whose vectors are further away
+ * from the target vector than the threshold according
+ * to a normalized ({@code 0 <= c <= 0}) distance.
+ *
+ *
+ * Certainty is only meaningful for {@code cosine} distance.
+ * Prefer using {@link #distance(float)} to limit search results.
+ */
@SuppressWarnings("unchecked")
public SelfT certainty(float certainty) {
this.certainty = certainty;
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/Bm25.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/Bm25.java
index 9c48e6101..899487a62 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/Bm25.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/Bm25.java
@@ -39,15 +39,22 @@ public Builder(String query) {
this.query = query;
}
+ /** Select properties to be included in the results scoring. */
public Builder queryProperties(String... properties) {
return queryProperties(Arrays.asList(properties));
}
+ /** Select properties to be included in the results scoring. */
public Builder queryProperties(List properties) {
this.queryProperties.addAll(properties);
return this;
}
+ /**
+ * Select BM25
+ * Search Operator to use.
+ */
public Builder searchOperator(SearchOperator searchOperator) {
this.searchOperator = searchOperator;
return this;
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/ById.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/ById.java
index 5a2bee979..7beb43f90 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/ById.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/ById.java
@@ -48,33 +48,40 @@ public Builder(String uuid) {
returnMetadata(MetadataField.UUID);
}
+ /** Select properties to include in the query result. */
public final Builder returnProperties(String... properties) {
return returnProperties(Arrays.asList(properties));
}
+ /** Select properties to include in the query result. */
public final Builder returnProperties(List properties) {
this.returnProperties.addAll(properties);
return this;
}
+ /** Select cross-referenced objects to include in the query result. */
public final Builder returnReferences(QueryReference... references) {
return returnReferences(Arrays.asList(references));
}
+ /** Select cross-referenced objects to include in the query result. */
public final Builder returnReferences(List references) {
this.returnReferences.addAll(references);
return this;
}
+ /** Select metadata to include in the query result. */
public final Builder returnMetadata(Metadata... metadata) {
return returnMetadata(Arrays.asList(metadata));
}
+ /** Select metadata to include in the query result. */
public final Builder returnMetadata(List metadata) {
this.returnMetadata.addAll(metadata);
return this;
}
+ /** Include default vector. */
public final Builder includeVector() {
return returnMetadata(Metadata.VECTOR);
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/ConsistencyLevel.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/ConsistencyLevel.java
index 5ed88258f..326609d2e 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/ConsistencyLevel.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/ConsistencyLevel.java
@@ -6,8 +6,21 @@
import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet;
public enum ConsistencyLevel {
+ /**
+ * The operation succeeds as soon as one replica acknowledges the request. This
+ * is the fastest and most available, but least consistent option.
+ */
ONE(WeaviateProtoBase.ConsistencyLevel.CONSISTENCY_LEVEL_ONE, "ONE"),
+ /**
+ * The operation succeeds when a majority of replicas (calculated as
+ * replication_factor/2 + 1) respond. This provides a balance between
+ * consistency and availability.
+ */
QUORUM(WeaviateProtoBase.ConsistencyLevel.CONSISTENCY_LEVEL_ONE, "QUORUM"),
+ /**
+ * The operation succeeds only when all replicas respond. This is the most
+ * consistent but least available and slowest option.
+ */
ALL(WeaviateProtoBase.ConsistencyLevel.CONSISTENCY_LEVEL_ONE, "ALL");
private final WeaviateProtoBase.ConsistencyLevel consistencyLevel;
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/GroupBy.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/GroupBy.java
index e79bd1389..2cb430ffd 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/GroupBy.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/GroupBy.java
@@ -5,6 +5,13 @@
import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet;
public record GroupBy(List path, int maxGroups, int maxObjectsPerGroup) {
+ /**
+ * Group results by the property value.
+ *
+ * @param property Property name.
+ * @param maxGroups Maximum number of groups to return.
+ * @param maxObjectsPerGroup Maximum number of objects to include in a group.
+ */
public static GroupBy property(String property, int maxGroups, int maxObjectsPerGroup) {
return new GroupBy(List.of(property), maxGroups, maxObjectsPerGroup);
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/Hybrid.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/Hybrid.java
index c67412b87..dc5ef608f 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/Hybrid.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/Hybrid.java
@@ -62,40 +62,72 @@ public Builder(String query) {
this.query = query;
}
+ /** Select properties to be included in the results scoring. */
public Builder queryProperties(String... properties) {
return queryProperties(Arrays.asList(properties));
}
+ /** Select properties to be included in the results scoring. */
public Builder queryProperties(List properties) {
this.queryProperties = properties;
return this;
}
+ /**
+ * Select BM25
+ * Search Operator to use.
+ */
public Builder searchOperator(SearchOperator searchOperator) {
this.searchOperator = searchOperator;
return this;
}
+ /**
+ * Apply custom weighting between vector search and keyword search components.
+ *
+ *
+ * - {@code alpha=1}: Pure BM25 search
+ *
- {@code alpha=0}: Pure vector search
+ *
- {@code alpha>0.5}: More weight to vector search
+ *
- {@code alpha<0.5}: More weight to BM25 search
+ *
+ */
public Builder alpha(float alpha) {
this.alpha = alpha;
return this;
}
+ /**
+ * Select the fusion algorithm for combining
+ * vector search and keyword search results.
+ */
public Builder fusionType(FusionType fusionType) {
this.fusionType = fusionType;
return this;
}
+ /** Set the maximum allowable distance for the vector search component. */
public Builder maxVectorDistance(float maxVectorDistance) {
this.maxVectorDistance = maxVectorDistance;
return this;
}
+ /**
+ * Vector search component.
+ *
+ * @see NearVector#of
+ */
public Builder nearVector(NearVector nearVector) {
this.near = nearVector;
return this;
}
+ /**
+ * Vector search component.
+ *
+ * @see NearText#of
+ */
public Builder nearText(NearText nearText) {
this.near = nearText;
return this;
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryMetadata.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryMetadata.java
index 3573292ab..25f8f676e 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryMetadata.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryMetadata.java
@@ -4,13 +4,22 @@
import io.weaviate.client6.v1.api.collections.WeaviateMetadata;
import io.weaviate.client6.v1.internal.ObjectBuilder;
-public record QueryMetadata(String uuid,
+public record QueryMetadata(
+ /** Object UUID. */
+ String uuid,
+ /** Vector embeddings associated with the object. */
Vectors vectors,
+ /** Object creation time as a Unix timestamp. */
Long creationTimeUnix,
+ /** Unix timestamp of the latest object update. */
Long lastUpdateTimeUnix,
+ /** Distances to the search vector. */
Float distance,
+ /** Distance metric normalized to {@code 0 <= c <= 1} range. */
Float certainty,
+ /** BM25 ranking score. */
Float score,
+ /** Components of the BM25 ranking score. */
String explainScore) implements WeaviateMetadata {
private QueryMetadata(Builder builder) {
@@ -25,7 +34,7 @@ private QueryMetadata(Builder builder) {
builder.explainScore);
}
- public static class Builder implements ObjectBuilder {
+ static class Builder implements ObjectBuilder {
private String uuid;
private Vectors vectors;
private Long creationTimeUnix;
@@ -35,42 +44,42 @@ public static class Builder implements ObjectBuilder {
private Float score;
private String explainScore;
- public final Builder uuid(String uuid) {
+ final Builder uuid(String uuid) {
this.uuid = uuid;
return this;
}
- public final Builder vectors(Vectors vectors) {
+ final Builder vectors(Vectors vectors) {
this.vectors = vectors;
return this;
}
- public final Builder creationTimeUnix(Long creationTimeUnix) {
+ final Builder creationTimeUnix(Long creationTimeUnix) {
this.creationTimeUnix = creationTimeUnix;
return this;
}
- public final Builder lastUpdateTimeUnix(Long lastUpdateTimeUnix) {
+ final Builder lastUpdateTimeUnix(Long lastUpdateTimeUnix) {
this.lastUpdateTimeUnix = lastUpdateTimeUnix;
return this;
}
- public final Builder distance(Float distance) {
+ final Builder distance(Float distance) {
this.distance = distance;
return this;
}
- public final Builder certainty(Float certainty) {
+ final Builder certainty(Float certainty) {
this.certainty = certainty;
return this;
}
- public final Builder score(Float score) {
+ final Builder score(Float score) {
this.score = score;
return this;
}
- public final Builder explainScore(String explainScore) {
+ final Builder explainScore(String explainScore) {
this.explainScore = explainScore;
return this;
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryObjectGrouped.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryObjectGrouped.java
index 1000d6321..f35f3e824 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryObjectGrouped.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryObjectGrouped.java
@@ -3,8 +3,11 @@
import io.weaviate.client6.v1.api.collections.WeaviateObject;
public record QueryObjectGrouped(
+ /** Object properties. */
T properties,
+ /** Object metadata. */
QueryMetadata metadata,
+ /** Name of the group that the object belongs to. */
String belongsToGroup) {
QueryObjectGrouped(WeaviateObject object,
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryReference.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryReference.java
index f0a2c84a5..c6aac5a77 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryReference.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryReference.java
@@ -29,19 +29,44 @@ public QueryReference(Builder options) {
new ArrayList<>(options.returnMetadata));
}
+ /**
+ * Retrieve object referenced by a single-target cross-reference property.
+ *
+ * @param property Name of the cross-reference property.
+ */
public static QueryReference single(String property) {
return single(property, ObjectBuilder.identity());
}
+ /**
+ * Retrieve object referenced by a single-target cross-reference property.
+ *
+ * @param property Name of the cross-reference property.
+ * @param fn Lambda expression for optional parameters.
+ */
public static QueryReference single(String property, Function> fn) {
return fn.apply(new Builder(null, property)).build();
}
// TODO: check if we can supply mutiple collections
+
+ /**
+ * Retrieve object referenced by a multi-target cross-reference property.
+ *
+ * @param property Name of the cross-reference property.
+ * @param collection Name of the target collection.
+ */
public static QueryReference multi(String property, String collection) {
return multi(property, collection, ObjectBuilder.identity());
}
+ /**
+ * Retrieve object referenced by a multi-target cross-reference property.
+ *
+ * @param property Name of the cross-reference property.
+ * @param collection Name of the target collection.
+ * @param fn Lambda expression for optional parameters.
+ */
public static QueryReference multi(String property, String collection,
Function> fn) {
return fn.apply(new Builder(collection, property)).build();
@@ -62,38 +87,46 @@ public Builder(String collection, String property) {
returnMetadata(MetadataField.UUID);
}
+ /** Select vectors to return for each referenced object. */
public final Builder includeVectors(String... vectors) {
this.includeVectors.addAll(Arrays.asList(vectors));
return this;
}
+ /** Select properties to return for each referenced object. */
public final Builder returnProperties(String... properties) {
return returnProperties(Arrays.asList(properties));
}
+ /** Select properties to return for each referenced object. */
public final Builder returnProperties(List properties) {
this.returnProperties.addAll(properties);
return this;
}
+ /** Select nested references to return for each referenced object. */
public final Builder returnReferences(QueryReference... references) {
return returnReferences(Arrays.asList(references));
}
+ /** Select nested references to return for each referenced object. */
public final Builder returnReferences(List references) {
this.returnReferences.addAll(references);
return this;
}
+ /** Select metadata to return about each referenced object. */
public final Builder returnMetadata(Metadata... metadata) {
return returnMetadata(Arrays.asList(metadata));
}
+ /** Select metadata to return about each referenced object. */
public final Builder returnMetadata(List metadata) {
this.returnMetadata.addAll(metadata);
return this;
}
+ /** Include the default vector of the referenced object. */
public final Builder includeVector() {
return returnMetadata(Metadata.VECTOR);
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGroup.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGroup.java
index 178af862c..5ad750051 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGroup.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGroup.java
@@ -3,9 +3,20 @@
import java.util.List;
public record QueryResponseGroup(
+ /** Group name. */
String name,
+ /**
+ * The smallest distance value among all objects in the group, indicating the
+ * most similar object in that group to the query
+ */
Float minDistance,
+ /**
+ * The largest distance value among all objects in the group, indicating the
+ * least similar object in that group to the query.
+ */
Float maxDistance,
+ /** The size of the group. */
long numberOfObjects,
+ /** Objects retrieved in the query. */
List> objects) {
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGrouped.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGrouped.java
index 4c9383527..9ee8442fa 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGrouped.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGrouped.java
@@ -4,6 +4,8 @@
import java.util.Map;
public record QueryResponseGrouped(
+ /** All objects retrieved in the query. */
List> objects,
+ /** Grouped response objects. */
Map> groups) {
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/WeaviateQueryClient.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/WeaviateQueryClient.java
index 81a7c11b1..d88588450 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/WeaviateQueryClient.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/WeaviateQueryClient.java
@@ -42,5 +42,4 @@ protected final QueryResponseGrouped performRequest(QueryOperator operator, G
var request = new QueryRequest(operator, groupBy);
return this.grpcTransport.performRequest(request, QueryRequest.grouped(collection, defaults));
}
-
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/WeaviateQueryClientAsync.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/WeaviateQueryClientAsync.java
index 0c195e80d..a774d0e29 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/WeaviateQueryClientAsync.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/WeaviateQueryClientAsync.java
@@ -43,5 +43,4 @@ protected final CompletableFuture> performRequest(QueryO
var request = new QueryRequest(operator, groupBy);
return this.grpcTransport.performRequestAsync(request, QueryRequest.grouped(collection, defaults));
}
-
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/Where.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/Where.java
index bde53a695..807f9aa6f 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/query/Where.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/Where.java
@@ -94,14 +94,17 @@ public static Where or(List operands) {
// Comparison operators return fluid builder.
// --------------------------------------------------------------------------
+ /** Filter by object UUID. */
public static WhereBuilder uuid() {
return property(ById.ID_PROPERTY);
}
+ /** Filter by object property. */
public static WhereBuilder property(String property) {
return new WhereBuilder(new PathOperand(property));
}
+ /** Filter by a property of the referenced object. */
public static WhereBuilder reference(String... path) {
return new WhereBuilder(new PathOperand(path));
}
diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/tenants/WeaviateTenantsClient.java b/src/main/java/io/weaviate/client6/v1/api/collections/tenants/WeaviateTenantsClient.java
index 37385672a..fadb596db 100644
--- a/src/main/java/io/weaviate/client6/v1/api/collections/tenants/WeaviateTenantsClient.java
+++ b/src/main/java/io/weaviate/client6/v1/api/collections/tenants/WeaviateTenantsClient.java
@@ -5,6 +5,7 @@
import java.util.List;
import java.util.Optional;
+import io.weaviate.client6.v1.api.WeaviateApiException;
import io.weaviate.client6.v1.internal.grpc.GrpcTransport;
import io.weaviate.client6.v1.internal.orm.CollectionDescriptor;
import io.weaviate.client6.v1.internal.rest.RestTransport;
@@ -23,71 +24,236 @@ public WeaviateTenantsClient(
this.grpcTransport = grpcTransport;
}
+ /**
+ * Add more tenants to the collection.
+ *
+ * @param tenants Tenant configurations.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @throws IOException in case the request was not sent successfully
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
public void create(Tenant... tenants) throws IOException {
create(Arrays.asList(tenants));
}
+ /**
+ * Add more tenants to the collection.
+ *
+ * @param tenants Tenant configurations.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @throws IOException in case the request was not sent successfully
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
public void create(List tenants) throws IOException {
this.restTransport.performRequest(new CreateTenantsRequest(tenants), CreateTenantsRequest.endpoint(collection));
}
+ /**
+ * Get tenant information.
+ *
+ * @param tenant Tenant name.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
public Optional get(String tenant) {
var tenants = get(List.of(tenant));
return tenants.isEmpty() ? Optional.empty() : Optional.ofNullable(tenants.get(0));
}
+ /**
+ * List all existing tenants.
+ *
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
public List list() {
return get();
}
+ /**
+ * List selected tenants.
+ *
+ * @param tenants Tenant names.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
public List get(String... tenants) {
return get(Arrays.asList(tenants));
}
+ /**
+ * List selected tenants.
+ *
+ * @param tenants Tenant names.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ */
public List get(List tenants) {
return this.grpcTransport.performRequest(new GetTenantsRequest(tenants), GetTenantsRequest.rpc(collection));
}
+ /**
+ * Update tenant configuration.
+ *
+ * @param tenants Tenant names.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @throws IOException in case the request was not sent successfully
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
public void update(Tenant... tenants) throws IOException {
update(Arrays.asList(tenants));
}
+ /**
+ * Update tenant configuration.
+ *
+ * @param tenants Tenant names.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @throws IOException in case the request was not sent successfully
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
public void update(List tenants) throws IOException {
this.restTransport.performRequest(new UpdateTenantsRequest(tenants), UpdateTenantsRequest.endpoint(collection));
}
+ /**
+ * Delete selected tenants.
+ *
+ * @param tenants Tenant names.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @throws IOException in case the request was not sent successfully
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
public void delete(String... tenants) throws IOException {
delete(Arrays.asList(tenants));
}
+ /**
+ * Delete selected tenants.
+ *
+ *
+ * @param tenants Tenant names.
+ * @throws WeaviateApiException in case the server returned with an
+ * error status code.
+ * @throws IOException in case the request was not sent successfully
+ * due to a malformed request, a networking error
+ * or the server being unavailable.
+ */
public void delete(List