PgKeywordIndex

org.llm4s.vectorstore.PgKeywordIndex
See thePgKeywordIndex companion class

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class Config(host: String, port: Int, database: String, user: String, password: String, tableName: String, maxPoolSize: Int, language: String)

Configuration for PgKeywordIndex.

Configuration for PgKeywordIndex.

Value parameters

database

Database name

host

Database host

language

PostgreSQL text search configuration (default: "english")

maxPoolSize

Maximum connection pool size (default: 10)

password

Database password

port

Database port

tableName

Base table name (creates {tableName}_keyword table)

user

Database user

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Config

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Config.type

Value members

Concrete methods

Create a PgKeywordIndex from configuration.

Create a PgKeywordIndex from configuration.

Value parameters

config

The index configuration

Attributes

Returns

The keyword index or error

def apply(dataSource: HikariDataSource, tableName: String, language: String): Result[PgKeywordIndex]

Create a PgKeywordIndex with an existing HikariDataSource.

Create a PgKeywordIndex with an existing HikariDataSource.

Useful for sharing a connection pool with PgVectorStore.

Value parameters

dataSource

Existing HikariDataSource

language

PostgreSQL text search configuration

tableName

Base table name

Attributes

Returns

The keyword index or error

def apply(dataSource: HikariDataSource, tableName: String): Result[PgKeywordIndex]

Create a PgKeywordIndex with an existing HikariDataSource using default language.

Create a PgKeywordIndex with an existing HikariDataSource using default language.

Note: The provided dataSource will NOT be closed when the index is closed. The caller is responsible for managing the dataSource lifecycle.

Value parameters

dataSource

Existing HikariDataSource

tableName

Base table name

Attributes

Returns

The keyword index or error

def apply(connectionString: String, user: String, password: String, tableName: String): Result[PgKeywordIndex]

Create a PgKeywordIndex from connection string.

Create a PgKeywordIndex from connection string.

Value parameters

connectionString

PostgreSQL connection string (jdbc:postgresql://...)

password

Database password

tableName

Base table name

user

Database user

Attributes

Returns

The keyword index or error

def local(tableName: String): Result[PgKeywordIndex]

Create a PgKeywordIndex with default local settings.

Create a PgKeywordIndex with default local settings.

Connects to localhost:5432/postgres with user postgres.

Value parameters

tableName

Base table name

Attributes

Returns

The keyword index or error