durga bidaye
2006-Apr-18 04:06 UTC
[Xapian-discuss] gettin erro with xapian binidngs 0.9.5
hi i had created an indexer n searcher in php in 0.9.4 and it was workin fine. now i installed 0.9.5 but i m getting following error *Fatal error*: No matching function for overloaded 'Document_add_posting' in */home/jana/public_html/final_file_search/file_indexer.php* on line *48 *this is the fragment of my code where i m gettin the error. -------------------------------------------------------------------------- $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= rtrim(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_flush($database); $database = Null; -------------------------------------------------------------------------------------------------- Plz help.... Btw i had to install 0.9.5 coz i reinstalled my OS n on xapian.org, the earlier version ie. 0.9.4 was not available. Can i obtain the earlier version somehow? Thanks Durga doubtfire40008@gmail.com
On Tue, Apr 18, 2006 at 08:36:47AM +0530, durga bidaye wrote:> Plz help.... Btw i had to install 0.9.5 coz i reinstalled my OS n on > xapian.org, the earlier version ie. 0.9.4 was not available. Can i obtain > the earlier version somehow?0.9.5 fixed a problem with PHP overload resolution - if there was no match found 0.9.4 would silently ignore the problem and just return having not called Xapian at all. In this situation, 0.9.5 gives the error you're getting. So returning to 0.9.4 will probably just hide a bug in your code.> *Fatal error*: No matching function for overloaded 'Document_add_posting' in > */home/jana/public_html/final_file_search/file_indexer.php* on line *48> $pos=$pieces[1]; > Document_add_posting($doc, $term, $pos);So this probably means that one of the parameters isn't the right type sometimes (at a guess, it's probably going wrong at the end of the input file). To find out, add this on the line before the call to Document_add_posting and run it again: echo gettype($doc)," ",gettype($term)," ",gettype($pos),"\n"; Cheers, Olly