Class PostgresOptions
Configuration options for PostgresStore.
public class PostgresOptions
- Inheritance
-
PostgresOptions
- Inherited Members
Properties
ConnectionString
PostgreSQL connection string. Required.
public string ConnectionString { get; set; }
Property Value
Dimension
Embedding vector dimension. Must match the dimension used by the embedding provider. Required (must be greater than 0).
public int Dimension { get; set; }
Property Value
DistanceStrategy
Distance function for similarity search. Default: Cosine.
public DistanceStrategy DistanceStrategy { get; set; }
Property Value
EnsureSchema
When true, automatically creates the pgvector extension, table, and indexes if they do not exist. Recommended for development/testing only. When false (default), the schema must already exist or an exception is thrown.
public bool EnsureSchema { get; set; }
Property Value
FailFastOnIndexCreationFailure
When true (default), index creation failures throw and fail fast. When false, index creation failures are downgraded to warnings and startup continues.
public bool FailFastOnIndexCreationFailure { get; set; }
Property Value
Index
Vector index settings. Default: HnswIndexOptions.
public VectorIndexOptions Index { get; set; }
Property Value
SchemaName
Database schema name. Default: "public".
public string SchemaName { get; set; }
Property Value
TableName
Table name for vector storage. Default: "vectors".
public string TableName { get; set; }
Property Value
TextSearchConfig
PostgreSQL text search configuration used for to_tsvector / plainto_tsquery
in hybrid search. Default: "simple".
Only used when TextSearchMode is TsVector.
The simple configuration performs whitespace-based tokenization without
morphological analysis. This works well for English but may produce poor recall
for agglutinative languages such as Korean, Japanese, or Finnish where particles
and inflections are attached to words.
To improve hybrid search quality for such languages, install a language-specific
text search configuration (e.g. pg_mecab for Korean/Japanese) and set this
property accordingly, or use Trigram instead.
public string TextSearchConfig { get; set; }
Property Value
TextSearchMode
Text search mode for the keyword leg of hybrid search. Default: TsVector.
TsVector: PostgreSQL full-text search
(tsvector / tsquery). Suitable for European languages with good
built-in text search configurations.
Trigram: pg_trgm word_similarity matching.
Better for CJK languages (Korean, Japanese, Chinese) where PostgreSQL
lacks built-in morphological analysis. Requires the pg_trgm
extension (standard PostgreSQL contrib module, available on most managed services).
public TextSearchMode TextSearchMode { get; set; }
Property Value
Methods
Validate()
Validates the options and throws ArgumentException if invalid.
public void Validate()