Class: abstract
BaseIndex<T>
Indexes are the data structure that we store our nodes and embeddings in so they can be retrieved for our queries.
Extended by
Type parameters
• T
Constructors
new BaseIndex()
new BaseIndex<
T
>(init
):BaseIndex
<T
>
Parameters
• init: BaseIndexInit
<T
>
Returns
BaseIndex
<T
>
Source
packages/llamaindex/src/indices/BaseIndex.ts:64
Properties
docStore
docStore:
BaseDocumentStore
Source
packages/llamaindex/src/indices/BaseIndex.ts:60
indexStore?
optional
indexStore:BaseIndexStore
Source
packages/llamaindex/src/indices/BaseIndex.ts:61
indexStruct
indexStruct:
T
Source
packages/llamaindex/src/indices/BaseIndex.ts:62
serviceContext?
optional
serviceContext:ServiceContext
Source
packages/llamaindex/src/indices/BaseIndex.ts:58
storageContext
storageContext:
StorageContext
Source
packages/llamaindex/src/indices/BaseIndex.ts:59
Methods
asQueryEngine()
abstract
asQueryEngine(options
?):QueryEngine
Create a new query engine from the index. It will also create a retriever and response synthezier if they are not provided.
Parameters
• options?
you can supply your own custom Retriever and ResponseSynthesizer
• options.responseSynthesizer?: BaseSynthesizer
• options.retriever?: BaseRetriever
Returns
Source
packages/llamaindex/src/indices/BaseIndex.ts:83
asRetriever()
abstract
asRetriever(options
?):BaseRetriever
Create a new retriever from the index.
Parameters
• options?: any
Returns
Source
packages/llamaindex/src/indices/BaseIndex.ts:76
deleteRefDoc()
abstract
deleteRefDoc(refDocId
,deleteFromDocStore
?):Promise
<void
>
Parameters
• refDocId: string
• deleteFromDocStore?: boolean
Returns
Promise
<void
>
Source
packages/llamaindex/src/indices/BaseIndex.ts:102
insert()
insert(
document
):Promise
<void
>
Insert a document into the index.
Parameters
• document: Document
<Metadata
>
Returns
Promise
<void
>
Source
packages/llamaindex/src/indices/BaseIndex.ts:92
insertNodes()
abstract
insertNodes(nodes
):Promise
<void
>
Parameters
• nodes: BaseNode
<Metadata
>[]
Returns
Promise
<void
>