Home Reference Source
public class | source

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

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

async state(): object

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:

NameTypeAttributeDescription
config IRSystem
  • optional
  • default: {}

configuration/state. Can be result of state(). See attributes.

Public Members

public idField: string source

id field name

public indices: Index[] source

system indices

public processors: Processor[] source

system processors

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:

NameTypeAttributeDescription
documents Document[]

document set to add

public addIndex(index: *): IRSystem source

Add a new index to the system.

Params:

NameTypeAttributeDescription
index *

Return:

IRSystem

public addProcessor(processor: *): * source

Params:

NameTypeAttributeDescription
processor *

Return:

*

public async getFilterResults(filter: *, score: *): * source

Params:

NameTypeAttributeDescription
filter *
score *

Return:

*

public helperRemoveIndices(indices: *) source

Params:

NameTypeAttributeDescription
indices *

public meta(): * source

Return:

*

public async removeDocuments(documents: Document[]) source

Remove a set of documents from the IR system.

Params:

NameTypeAttributeDescription
documents Document[]

document set to add

public async retrieveDocuments(query: Query): Document[] source

Retrieve a list of documents that matches a query.

Params:

NameTypeAttributeDescription
query Query

query

Return:

Document[]

retrieve

public async state(): object source

Dump current system state

Return:

object

public updateDocuments(documents: Document[]): * source

Alias of addDocuments.

Add is the same as update in this system.

Params:

NameTypeAttributeDescription
documents Document[]

document set to add

Return:

*

Protected Methods

protected async getAndResults(values: *, score: *): * source

Params:

NameTypeAttributeDescription
values *
score *

Return:

*

protected async getNotResults(filter: *, score: *): * source

Params:

NameTypeAttributeDescription
filter *
score *

Return:

*

protected async getOrResults(values: *, score: *): * source

Params:

NameTypeAttributeDescription
values *
score *

Return:

*

protected async getResults(filter: *, score: *): * source

Params:

NameTypeAttributeDescription
filter *
score *

Return:

*

protected helperGetIndex(record: *): * source

Params:

NameTypeAttributeDescription
record *

Return:

*