created on 30 Aug 2008, by Syndication, read more…
You want XapianTermGenerator, which takes a blob of text and adds all the
words in it to Xapian. e.g. (snippet of the written-in-PHP
http://sandwich.ukcod.org.uk/~matthew/subtitles/?source=1#indexer ):
$indexer = new XapianTermGenerator();
$indexer->set_flags(128);
$indexer->set_database($db); # For spelling
[... then for each document ... ]
$doc = new XapianDocument();
$indexer->set_document($doc);
$doc->set_data( [...] );
$doc->add_term( [...] );
$doc->add_value( [...] );
$indexer->index_text($text);
$db->add_document($doc);
ATB,
Matthew