Gossamer Forum
Quote Reply
GT::SQL::Search and JOIN
How can I do a join with GT::SQL::Search?

the task is following


my $master_cond = new GT::SQL::Condition;
$master_cond->add(forum_id_fk => IN => \$forums);

my $sth;
my $hits;

my $p = $DB->table('Bookmarks', 'Post');
$sth = $p->query_sth(
query => $term,
filter => $master_cond,
mh => $mh,
nh => $pg,
sb => $sb,
so => $so,
bool => 'AND',
$hits = $p->hits();

how can I join 'Bookmarks' and 'Post'?

With Bookmarks table alone it works fine even with internal indexing, but I need some restrictions on forum_id. So I have do join on post_id_fk=post_id.

The error:
gforum.cgi: GT::SQL::Relation (24332): Unknown method 'weight' called at ....../gforum/admin/GT/SQL/Search/NONINDEXED/Search.pm line 187.

I know, that I know nothing.

Last edited by:

eoeser: Jun 23, 2007, 3:19 PM
Quote Reply
Re: [eoeser] GT::SQL::Search and JOIN In reply to
ok, it's a little bit dirty, I take the the collective stuff into $tables->select_options(...) now.
It works, but in my mind it has to be cleaner.

I know, that I know nothing.