Skip to main content
Methods available on the TFIDFVectoria class.

addDocument()

Add a document to the index.

Signature

Example

After adding documents, you must call reindex() before searching.

reindex()

Rebuild the TF-IDF index. Required after document changes.

Signature

Example


Search for documents using TF-IDF similarity.

Signature

Parameters

Example


removeDocument()

Remove a document from the index.

Signature

Example


getDocument()

Get a document by ID.

Signature


hasDocument()

Check if a document exists.

Signature


size()

Get the number of documents.

Signature


clear()

Remove all documents.

Signature

Complete Example

TFIDFVectoria Constructor

Create instance

TF-IDF Guide

Usage guide