import System from 'information-retrieval-boilerplate/node-information-retrieval-boilerplate/src/System.js'
System
Information Retrieval System Main Class
Basic workflow is:
- create a new IRSystem
- add indices
- manage(add/remove/update)/retrive document collection/sets
or:
- create a new IRSystem with saved state from another IRSystem
- manage(add/remove/update)/retrive documents
Constructor Summary
Public Constructor | ||
public |
constructor(config: IRSystem) Construct new IR system. |
Member Summary
Public Members | ||
public |
id field name |
|
public |
system indices |
|
public |
system processors |
|
public |
processorsLookup: {} |
Method Summary
Public Methods | ||
public |
async addDocuments(documents: Document[]) Add a set of documents to the IR system. |
|
public |
addIndex(index: *): IRSystem Add a new index to the system. |
|
public |
addProcessor(processor: *): * |
|
public |
async getFilterResults(filter: *, score: *): * |
|
public |
helperRemoveIndices(indices: *) |
|
public |
meta(): * |
|
public |
async removeDocuments(documents: Document[]) Remove a set of documents from the IR system. |
|
public |
async retrieveDocuments(query: Query): Document[] Retrieve a list of documents that matches a query. |
|
public |
Dump current system state |
|
public |
updateDocuments(documents: Document[]): * Alias of addDocuments. |
Protected Methods | ||
protected |
async getAndResults(values: *, score: *): * |
|
protected |
async getNotResults(filter: *, score: *): * |
|
protected |
async getOrResults(values: *, score: *): * |
|
protected |
async getResults(filter: *, score: *): * |
|
protected |
helperGetIndex(record: *): * |
Public Constructors
public constructor(config: IRSystem) source
Construct new IR system.
Params:
Name | Type | Attribute | Description |
config | IRSystem |
|
configuration/state. Can be result of state(). See attributes. |
Public Members
public processorsLookup: {} source
Public Methods
public async addDocuments(documents: Document[]) source
Add a set of documents to the IR system.
Documents are added and removed in bulk for abusing any potential optimisations which might be available for doing things in bulk.
Params:
Name | Type | Attribute | Description |
documents | Document[] | document set to add |
public addIndex(index: *): IRSystem source
Add a new index to the system.
Params:
Name | Type | Attribute | Description |
index | * |
Return:
IRSystem |
public addProcessor(processor: *): * source
Params:
Name | Type | Attribute | Description |
processor | * |
Return:
* |
public async getFilterResults(filter: *, score: *): * source
Params:
Name | Type | Attribute | Description |
filter | * | ||
score | * |
Return:
* |
public helperRemoveIndices(indices: *) source
Params:
Name | Type | Attribute | Description |
indices | * |
public async removeDocuments(documents: Document[]) source
Remove a set of documents from the IR system.
Params:
Name | Type | Attribute | Description |
documents | Document[] | document set to add |
public async retrieveDocuments(query: Query): Document[] source
Retrieve a list of documents that matches a query.
Params:
Name | Type | Attribute | Description |
query | Query | query |
public updateDocuments(documents: Document[]): * source
Alias of addDocuments.
Add is the same as update in this system.
Params:
Name | Type | Attribute | Description |
documents | Document[] | document set to add |
Return:
* |
Protected Methods
protected async getAndResults(values: *, score: *): * source
Params:
Name | Type | Attribute | Description |
values | * | ||
score | * |
Return:
* |
protected async getNotResults(filter: *, score: *): * source
Params:
Name | Type | Attribute | Description |
filter | * | ||
score | * |
Return:
* |
protected async getOrResults(values: *, score: *): * source
Params:
Name | Type | Attribute | Description |
values | * | ||
score | * |
Return:
* |
protected async getResults(filter: *, score: *): * source
Params:
Name | Type | Attribute | Description |
filter | * | ||
score | * |
Return:
* |
protected helperGetIndex(record: *): * source
Params:
Name | Type | Attribute | Description |
record | * |
Return:
* |