Class: KeywordTableIndex
The KeywordTableIndex, an index that extracts keywords from each Node and builds a mapping from each keyword to the corresponding Nodes of that keyword.
Extends
Constructors
new KeywordTableIndex()
new KeywordTableIndex(
init
):KeywordTableIndex
Parameters
• init: BaseIndexInit
<KeywordTable
>
Returns
Overrides
Defined in
packages/llamaindex/src/indices/keyword/index.ts:159
Properties
docStore
docStore:
BaseDocumentStore
Inherited from
Defined in
packages/llamaindex/src/indices/BaseIndex.ts:60
indexStore?
optional
indexStore:BaseIndexStore
Inherited from
Defined in
packages/llamaindex/src/indices/BaseIndex.ts:61
indexStruct
indexStruct:
KeywordTable
Inherited from
Defined in
packages/llamaindex/src/indices/BaseIndex.ts:62
serviceContext?
optional
serviceContext:ServiceContext
Inherited from
Defined in
packages/llamaindex/src/indices/BaseIndex.ts:58
storageContext
storageContext:
StorageContext
Inherited from
Defined in
packages/llamaindex/src/indices/BaseIndex.ts:59
Methods
asQueryEngine()
asQueryEngine(
options
?):BaseQueryEngine
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.nodePostprocessors?: BaseNodePostprocessor
[]
• options.preFilters?: unknown
• options.responseSynthesizer?: BaseSynthesizer
• options.retriever?: BaseRetriever
Returns
Overrides
Defined in
packages/llamaindex/src/indices/keyword/index.ts:239
asRetriever()
asRetriever(
options
?):BaseRetriever
Create a new retriever from the index.
Parameters
• options?: any
Returns
Overrides
Defined in
packages/llamaindex/src/indices/keyword/index.ts:228
deleteNode()
deleteNode(
nodeId
):void
Parameters
• nodeId: string
Returns
void
Defined in
packages/llamaindex/src/indices/keyword/index.ts:337
deleteNodes()
deleteNodes(
nodeIds
,deleteFromDocStore
):Promise
<void
>
Parameters
• nodeIds: string
[]
• deleteFromDocStore: boolean
Returns
Promise
<void
>
Defined in
packages/llamaindex/src/indices/keyword/index.ts:355
deleteRefDoc()
deleteRefDoc(
refDocId
,deleteFromDocStore
?):Promise
<void
>
Parameters
• refDocId: string
• deleteFromDocStore?: boolean
Returns
Promise
<void
>
Overrides
Defined in
packages/llamaindex/src/indices/keyword/index.ts:369
insert()
insert(
document
):Promise
<void
>
Insert a document into the index.
Parameters
• document: Document
<Metadata
>
Returns
Promise
<void
>
Inherited from
Defined in
packages/llamaindex/src/indices/BaseIndex.ts:92
insertNodes()
insertNodes(
nodes
):Promise
<void
>
Parameters
Returns
Promise
<void
>
Overrides
Defined in
packages/llamaindex/src/indices/keyword/index.ts:327
buildIndexFromNodes()
static
buildIndexFromNodes(nodes
,docStore
,serviceContext
?):Promise
<KeywordTable
>
Get keywords for nodes and place them into the index.