tfidf.php
Table of Contents
Functions
- tfidf() : string
- Score documents with the term frequency–inverse document frequency algorithm (TF-IDF).
Functions
tfidf()
Score documents with the term frequency–inverse document frequency algorithm (TF-IDF).
tfidf(string $doc[, bool|null $normalize = null ]) : string
Wraps the ArangoDB AQL scoring function TFIDF(doc, normalize). The first
argument must be the document variable emitted by a FOR … IN viewName
operation, and the function can only be used together with a SEARCH. Sort
descending by the score to get the most relevant documents first.
Example AQL usage:
FOR doc IN viewName
SEARCH ...
SORT TFIDF(doc) DESC
RETURN doc
Parameters
- $doc : string
-
The document variable emitted by
FOR … IN viewName(kept raw). - $normalize : bool|null = null
-
Optional — whether to normalize the score (server default
false).
Tags
Return values
string —The formatted AQL expression.