[Xapian-discuss] PHP indexing, what's the PHP method for indexscript

athlon athlonf athlonkmf at yahoo.com
Tue Jan 15 22:32:47 GMT 2008


Hi James,

thanks for the answer.
Indeed if I do something like this:
        $data = 'author='.$postrow['starter_name']."\n";
            $data .= 'authorid='.$postrow['starter_id']."\n";
            $data .= 'forum_id='.$postrow['forum_id']."\n";
            $doc->set_data($data);    
        
It will be correctly inserted.

However, what do you mean with "you could pull data out of wherever it came from to display
it"?
That I could parse the result by looking back at the datasource (a database)? I guess there are pro and con's about that.


----- Original Message ----
From: James Aylett <james-xapian at tartarus.org>
To: xapian-discuss at lists.xapian.org
Sent: Tuesday, January 15, 2008 10:47:09 PM
Subject: Re: [Xapian-discuss] PHP indexing, what's the PHP method for indexscript


On Tue, Jan 15, 2008 at 01:04:10PM -0800, athlon athlonf wrote:

> How can I create the same indexing using PHP?  With this, I can get
> an searchable index, but I have no idea how to set the fields, so
> that I can actually GET something back (with the underneath code, I
> just get a bunch of pid's back).
> 
> $doc = new XapianDocument();
> $doc->set_data($postrow['pid']);    

You're setting the document data field to just the pid. If you want it
to be compatible with omega, you'll need to put the right data in
there, as documented in ``Document data construction'' in
omega/docs/overview.html. Alternatively, if you're using your own
searcher, you could pull data out of wherever it came from to display
it and cut down on data duplication - which makes more sense depends
on a huge number of factors. The former is the easier to migrate
gradually from the omega tools to your own system.

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                
  xapian.org
  james at tartarus.org                              
 uncertaintydivision.org

_______________________________________________
Xapian-discuss mailing list
Xapian-discuss at lists.xapian.org
http://lists.xapian.org/mailman/listinfo/xapian-discuss





      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 




More information about the Xapian-discuss mailing list