use MyConText; use DBI; # connect to database (regular DBI) my $dbh = DBI->connect('dbi:mysql:database', 'user', 'passwd'); # create a new index my $ctx = MyConText->create($dbh, 'indexname', 'frontend' => 'file', 'backend' => 'phrase'); # or open existing one # my $ctx = MyConText->open($dbh, 'indexname'); # index documents $ctx->index_document('/path/to/file'); # search for matches, finds documents that contain "anybody", "somebody", "nobody", etc. my @documents = $ctx->contains('%body');