[Xapian-discuss] "WritableDatabase_add_document" error
durga bidaye
doubtfire40008 at gmail.com
Wed Mar 29 11:44:01 BST 2006
hello
i implemented a simplesearch n simpleindex fr files in devanagari script
using xapian-core(C++). now when i tried doin indexin using php on the same
files i m gettin following error.
Fatal error: Type error in argument 1 of WritableDatabase_add_document.
Expected SWIGTYPE_p_Xapian__WritableDatabase in
/home/jana/public_html/temp/file_search/indexer.php on line 50
i also checked if the argument to the function is wrong..but it isnt...this
is my a part of my code.
$database = new_Database($dbp);
if (!$database) {
print "Couldn't open database<br>";
exit;
}
else
echo "<br>db opened!";
$doc = new_Document();
Document_set_data($doc,$filep);
$lines=file("op.txt");
//count is used to overcome an error in extract_from_file11..it returns a
file containing one extracted devanagari word per line plus its postion(ie.
on which line it appears..line is defined as something that ends with Hindi
"|" ie.full stop)
$count=0;
//$t1=time();
foreach($lines as $l)
{
if($count==0)
{
$count++;
continue;
}
$pieces=explode(" ",$l);
$term= trim(souindics(souindics_preprocess($pieces[0])));
echo $term." ".$pieces[1]."<br>";
$pos=$pieces[1];
Document_add_posting($doc, $term, $pos);
}//end for
WritableDatabase_add_document($database, $doc);
WritableDatabase_add_document($database, $doc);
WritableDatabase_flush($database);
$database = Null;
plz help.
Thanks.
Durga
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.tartarus.org/pipermail/xapian-discuss/attachments/20060329/ff8ef021/attachment-0001.htm
More information about the Xapian-discuss
mailing list