Name
vt_word_string_id_init,
vt_word_string_id_acc,
vt_word_string_id_final,
vt_word_string_ro_id_final,
vt_word_string_ends,
vt_word_string_details,
vt_batch_alpha_range,
vt_batch_array_sort,
vt_batch_feed_wordump,
vt_batch_strings,
vt_batch_strings_array,
vt_batch_wordump,
vt_batch_words_length,
vt_load_stop_words,
wb_apply,
wb_all_done_bif,
key_is_d_id_partition
—
free-text indexer batch and word-string runtime primitives
Synopsis
any vt_word_string_id_init(
|
); |
vt_word_string_id_acc(
|
inout acc any, |
| |
in word any); |
any vt_word_string_id_final(
|
inout acc any); |
any vt_word_string_ro_id_final(
|
inout acc any); |
any vt_word_string_ends(
|
in word_string varchar); |
any vt_word_string_details(
|
in word_string varchar, |
| |
in print integer); |
vt_batch_alpha_range(
|
inout vtb any, |
| |
in lower varchar, |
| |
in upper varchar); |
vt_batch_array_sort(
|
inout arr any); |
vt_batch_feed_wordump(
|
inout vtb any, |
| |
in data any, |
| |
in is_delete integer); |
vt_batch_strings(
|
inout vtb any, |
| |
inout session any); |
any vt_batch_strings_array(
|
inout vtb any); |
vt_batch_wordump(
|
inout vtb any, |
| |
inout session any); |
integer vt_batch_words_length(
|
in vtb any); |
any vt_load_stop_words(
|
in file varchar); |
any wb_apply(
|
in original varchar, |
| |
in batch any, |
| |
in end_id_2 any, |
| |
in max integer); |
integer wb_all_done_bif(
|
in word_batch any); |
integer key_is_d_id_partition(
|
in key any); |
Description
This family of BIFs implements the runtime of Virtuoso's free-text index:
the per-batch accumulators emitted by the SQL compiler when maintaining a
WITH KEY text index, and the word-string primitives
that pack and unpack the on-disk word-id representation. They are intended
for internal use by the indexer and by the
explain output;
application code should rely on the higher-level
CONTAINS SQL syntax and the
vt_indexed_word_count
family instead.
The members fall into three groups:
-
Word-string id aggregator
-
vt_word_string_id_init,
vt_word_string_id_acc,
vt_word_string_id_final, and its read-only
variant vt_word_string_ro_id_final implement a
three-phase aggregate that collects the dictionary-ids of words seen
in a document. The result is the compact word-string form that the
text index stores per row.
-
Word-string inspectors
-
vt_word_string_ends returns the end markers of
a packed word-string; vt_word_string_details
dumps the internal layout for debugging (when
print is non-zero the contents are also
written to the server's stderr).
-
vt_batch_t accumulator
-
The vt_batch_* functions manipulate a
vt_batch_t, the compiler's per-row scratch state
for incremental free-text index maintenance:
vt_batch_alpha_range filters words to a lexical
range, vt_batch_feed_wordump appends an
insert/delete operation, vt_batch_strings and
vt_batch_strings_array serialise the staged
words (the array form returns a Virtuoso vector, the streaming form
writes to a string-session), vt_batch_wordump
writes a human-readable dump,
vt_batch_words_length returns the current
in-memory size, and vt_batch_array_sort sorts a
word-array in canonical order.
-
Maintenance / partition helpers
-
wb_apply merges a word batch produced by the
indexer into the existing word-string for a row, bounded by
max bytes.
wb_all_done_bif tests whether all entries in a
word-batch have been consumed.
vt_load_stop_words replaces the active
stop-word list with the contents of a text file (one word per line);
requires DBA privileges and respects the
DirsAllowed setting.
key_is_d_id_partition predicate used by the
partition planner to decide whether a key is part of the document-id
partitioning scheme.