Skip to content

Commit 676f56c

Browse files
committed
Enhance Weaviate Client Models with Detailed Documentation and New Features
- Added comprehensive XML documentation comments to the Move class, ObjectMetadata, Property, and various result models to improve clarity and usability. - Introduced new properties in ObjectMetadata for better metadata handling, including CreationTime, LastUpdateTime, Distance, Certainty, Score, ExplainScore, IsConsistent, and RerankScore. - Expanded the Property class with additional tokenization strategies and factory methods for various data types, enhancing property creation flexibility. - Implemented new GroupByResult and WeaviateGroup classes to support grouping in query results, along with generative AI capabilities in results. - Enhanced the WeaviateObject model with detailed properties for better data representation, including UUID, Collection, Metadata, Tenant, Properties, References, and Vectors. - Introduced HybridNearVector and HybridNearText records for hybrid search configurations, allowing for combined vector and text-based queries. - Updated ShardingConfig with detailed sharding strategies and functions, improving data distribution management. - Enhanced VectorConfig and VectorIndex classes with detailed documentation and new configurations for vector indexing and multi-vector search behavior.
1 parent 5fe1675 commit 676f56c

File tree

12 files changed

+1045
-27
lines changed

12 files changed

+1045
-27
lines changed

src/Weaviate.Client/Models/Collection.cs

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,78 @@
11
namespace Weaviate.Client.Models;
22

3+
/// <summary>
4+
/// Base class for collection configuration, containing common settings shared between creation and update operations.
5+
/// </summary>
6+
/// <remarks>
7+
/// A collection in Weaviate is similar to a table in traditional databases or a collection in MongoDB.
8+
/// It defines the schema (properties and references), indexing behavior, and various configurations
9+
/// for storing and searching data objects.
10+
/// </remarks>
311
public abstract record CollectionConfigCommon
412
{
13+
/// <summary>
14+
/// Gets or sets the name of the collection. Must be unique within the Weaviate instance.
15+
/// </summary>
516
public string Name { get; set; } = "";
17+
18+
/// <summary>
19+
/// Gets or sets the description of the collection, explaining its purpose and contents.
20+
/// </summary>
621
public string Description { get; set; } = "";
722

8-
// Define properties of the collection.
23+
/// <summary>
24+
/// Gets or sets the properties (data fields) defined for this collection.
25+
/// Properties define the schema for data objects stored in the collection.
26+
/// </summary>
927
public Property[] Properties { get; set; } = [];
28+
29+
/// <summary>
30+
/// Gets or sets the cross-references to other collections.
31+
/// References enable relationships between objects in different collections.
32+
/// </summary>
1033
public Reference[] References { get; set; } = [];
1134

12-
// inverted index config
35+
/// <summary>
36+
/// Gets or sets the inverted index configuration for filtering and keyword search.
37+
/// The inverted index is used for BM25 keyword search and filtering operations.
38+
/// </summary>
1339
public InvertedIndexConfig? InvertedIndexConfig { get; set; }
1440

41+
/// <summary>
42+
/// Gets or sets the reranker configuration for improving search result quality.
43+
/// Rerankers can reorder search results using more sophisticated models.
44+
/// </summary>
1545
public IRerankerConfig? RerankerConfig { get; set; }
1646

47+
/// <summary>
48+
/// Gets or sets the generative AI configuration for RAG (Retrieval-Augmented Generation).
49+
/// Enables integration with LLMs for generating text based on search results.
50+
/// </summary>
1751
public IGenerativeConfig? GenerativeConfig { get; set; }
1852

19-
// multi tenancy config
53+
/// <summary>
54+
/// Gets or sets the multi-tenancy configuration.
55+
/// Multi-tenancy enables data isolation for different tenants within the same collection.
56+
/// </summary>
2057
public MultiTenancyConfig? MultiTenancyConfig { get; set; }
2158

22-
// replication config
59+
/// <summary>
60+
/// Gets or sets the replication configuration for data redundancy and high availability.
61+
/// Controls how many copies of data are maintained across the cluster.
62+
/// </summary>
2363
public ReplicationConfig? ReplicationConfig { get; set; }
2464

25-
// Manage how the index should be sharded and distributed in the cluster
65+
/// <summary>
66+
/// Gets or sets the sharding configuration, controlling how data is distributed across cluster nodes.
67+
/// Sharding enables horizontal scaling of data storage and query performance.
68+
/// </summary>
2669
public ShardingConfig? ShardingConfig { get; set; }
2770

28-
// Configure named vectors. Either use this field or `vectorizer`, `vectorIndexType`, and `vectorIndexConfig` fields. Available from `v1.24.0`.
71+
/// <summary>
72+
/// Gets or sets the named vector configurations for this collection.
73+
/// Supports multiple vector spaces per collection (available from Weaviate v1.24.0).
74+
/// Use this for multi-vector setups, or use the legacy single-vector configuration.
75+
/// </summary>
2976
public VectorConfigList VectorConfig { get; set; } = default!;
3077

3178
public override int GetHashCode()

src/Weaviate.Client/Models/InvertedIndexConfig.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,57 @@
11
namespace Weaviate.Client.Models;
22

3+
/// <summary>
4+
/// Configuration for the inverted index used for filtering and keyword search.
5+
/// </summary>
6+
/// <remarks>
7+
/// The inverted index is used for filtering operations and BM25 keyword search.
8+
/// This configuration controls various aspects of index behavior including cleanup intervals,
9+
/// BM25 scoring, stopword handling, and timestamp indexing.
10+
/// </remarks>
311
public record InvertedIndexConfig : IEquatable<InvertedIndexConfig>
412
{
513
private static readonly Lazy<InvertedIndexConfig> defaultInstance =
614
new Lazy<InvertedIndexConfig>(() => new());
715

16+
/// <summary>
17+
/// Gets the default inverted index configuration with standard settings.
18+
/// </summary>
819
public static InvertedIndexConfig Default => defaultInstance.Value;
920

21+
/// <summary>
22+
/// Gets or sets the BM25 configuration for keyword search scoring. Defaults to <see cref="BM25Config.Default"/>.
23+
/// </summary>
1024
public BM25Config? Bm25 { get; set; } = BM25Config.Default;
25+
26+
/// <summary>
27+
/// Gets or sets the interval in seconds between index cleanup operations. Defaults to 60 seconds.
28+
/// </summary>
1129
public int CleanupIntervalSeconds { get; set; } = 60;
30+
31+
/// <summary>
32+
/// Gets or sets a value indicating whether to index null values for filtering. Defaults to false.
33+
/// </summary>
1234
public bool IndexNullState { get; set; } = false;
35+
36+
/// <summary>
37+
/// Gets or sets a value indicating whether to index property lengths for filtering. Defaults to false.
38+
/// </summary>
1339
public bool IndexPropertyLength { get; set; } = false;
40+
41+
/// <summary>
42+
/// Gets or sets a value indicating whether to index object timestamps (creation and update times). Defaults to false.
43+
/// </summary>
1444
public bool IndexTimestamps { get; set; } = false;
45+
46+
/// <summary>
47+
/// Gets or sets the stopword configuration for text processing. Defaults to <see cref="StopwordConfig.Default"/>.
48+
/// </summary>
1549
public StopwordConfig? Stopwords { get; set; } = StopwordConfig.Default;
50+
51+
/// <summary>
52+
/// Gets or sets a value indicating whether to use BlockMax WAND algorithm for faster BM25 queries.
53+
/// When null, Weaviate uses its default setting.
54+
/// </summary>
1655
public bool? UsingBlockMaxWAND { get; set; } = null;
1756

1857
public override int GetHashCode()

0 commit comments

Comments
 (0)