KeywordIndex

org.llm4s.vectorstore.KeywordIndex
See theKeywordIndex companion trait
object KeywordIndex

Factory for creating KeywordIndex instances.

Attributes

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

Members list

Value members

Concrete methods

Create an in-memory SQLite-based keyword index.

Create an in-memory SQLite-based keyword index.

Attributes

Returns

New keyword index

Create a PostgreSQL-based keyword index.

Create a PostgreSQL-based keyword index.

Uses PostgreSQL native full-text search with tsvector/tsquery. Provides BM25-like scoring via ts_rank_cd (cover density ranking).

Value parameters

config

PostgreSQL configuration

Attributes

Returns

New keyword index

def postgres(connectionString: String, user: String, password: String, tableName: String): Result[KeywordIndex]

Create a PostgreSQL-based keyword index from connection string.

Create a PostgreSQL-based keyword index from connection string.

Value parameters

connectionString

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

password

Database password

tableName

Base table name (creates {tableName}_keyword table)

user

Database user

Attributes

Returns

New keyword index

def postgresLocal(tableName: String): Result[KeywordIndex]

Create a PostgreSQL-based keyword index with default local settings.

Create a PostgreSQL-based keyword index with default local settings.

Connects to localhost:5432/postgres with user postgres.

Value parameters

tableName

Base table name

Attributes

Returns

New keyword index

def sqlite(path: String): Result[KeywordIndex]

Create a file-based SQLite keyword index.

Create a file-based SQLite keyword index.

Value parameters

path

Path to database file

Attributes

Returns

New keyword index