LuceneRagFacetProvider

class LuceneRagFacetProvider constructor(val name: String, val enhancers: List<<Error class: unknown class>> = emptyList(), embeddingModel: <Error class: unknown class>? = null, keywordExtractor: KeywordExtractor? = null, vectorWeight: Double = 0.5, chunkerConfig: <Error class: unknown class> = ContentChunker.DefaultConfig(), indexPath: Path? = null) : Closeable

Lucene RAG facet with optional vector search support via an EmbeddingModel. Supports both in-memory and disk-based persistence. Implements WritableContentElementRepository so we can add to the store.

Parameters

name

Name of this RAG service

embeddingModel

Optional embedding model for vector search; if null, only text search is supported

keywordExtractor

Optional keyword extractor for keyword-based search; if null, keyword search is disabled

vectorWeight

Weighting for vector similarity in hybrid search (0.0 to 1.0)

chunkerConfig

Configuration for content chunking

indexPath

Optional path for disk-based index storage; if null, uses in-memory storage

Constructors

Link copied to clipboard
constructor(name: String, enhancers: List<<Error class: unknown class>> = emptyList(), embeddingModel: <Error class: unknown class>? = null, keywordExtractor: KeywordExtractor? = null, vectorWeight: Double = 0.5, chunkerConfig: <Error class: unknown class> = ContentChunker.DefaultConfig(), indexPath: Path? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val enhancers: List<<Error class: unknown class>>
Link copied to clipboard
open val name: String

Functions

Link copied to clipboard
fun clear()

Clear all stored content - useful for testing

Link copied to clipboard
open override fun close()
Link copied to clipboard
open fun commit()
Link copied to clipboard
open fun count(): Int
Link copied to clipboard
open fun createRelationships(root: <Error class: unknown class>)
Link copied to clipboard
open fun deleteRootAndDescendants(uri: String): <Error class: unknown class>?
Link copied to clipboard
open fun facets(): List<<Error class: unknown class><out <Error class: unknown class>>>
Link copied to clipboard
fun findAll(): List<<Error class: unknown class>>
Link copied to clipboard
open fun findAllChunksById(chunkIds: List<String>): List<<Error class: unknown class>>
Link copied to clipboard
open fun findById(id: String): <Error class: unknown class>?
Link copied to clipboard
fun findChunkIdsByKeywords(keywords: Set<String>, minIntersection: Int = 1, maxResults: Int = 100): List<<Error class: unknown class><String, Int>>

Find chunk IDs by keyword intersection. Returns pairs of (chunkId, matchCount) sorted by match count descending.

Link copied to clipboard
open fun findChunksForEntity(entityId: String): List<<Error class: unknown class>>
Link copied to clipboard
open fun findContentRootByUri(uri: String): <Error class: unknown class>?
Link copied to clipboard

Get statistics about the current state

Link copied to clipboard
fun hybridSearch(ragRequest: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open fun infoString(verbose: Boolean?, indent: Int): String
Link copied to clipboard
fun keywordSearch(ragRequest: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Manually trigger loading of existing chunks from disk. Useful for ensuring chunks are loaded immediately after startup.

Link copied to clipboard
open fun onNewRetrievables(retrievables: List<<Error class: unknown class>>)
Link copied to clipboard
open fun save(element: <Error class: unknown class>): <Error class: unknown class>
Link copied to clipboard

Update keywords for existing chunks. This will re-index the chunks with new keywords.