Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Query + Field Searching - Please support bug fix

Quote Reply
Query + Field Searching - Please support bug fix
Hi All,

The Query Searching + other field searching is discussed in many places around this site (primarily in the context of category searching). There's mention of logic bugs in the search.pm query module. I have spent a considerable amount of time in trying to figure out where this particular bug is in hopes that I could fix it (it may or may not be related to other bugs in search.pm, that I don't know) but alas, it's too complex for me (see below for what I have discovered). Many threads say to wait for the new version of Links SQL, but for me (anybody else?), upgrading to that system is not be an option because of mods installed, and time constraints.

In any case, the query search is supposed to allow us to search for something like query=something&field=something. This type of search brings back only 1 hit instead of all the appropriate hits.

While I can't speak for others, my primary reason for upgrading to the SQL version was because of the search features, and I specifically asked about the above mentioned feature before purchasing, so I feel this bug fix should be supported.

If this bug can't be fixed, at least I would appreciate an explanation of why it can't be fixed. The error as you'll see below, is I hope, a relatively minor one:


In search.pm sub query there is this set of routines.
In Reply To:
my $sth = $self->{dbh}->prepare ( $query );
$sth->execute ();
my $row;
my %needed = map { $$_[0] => 1 } @query_results;
foreach $row ( $sth->fetchrow_hashref () ) {
delete $needed { $$row { $id_col } };
}
foreach $row ( keys %needed ) {
delete $$id_results { $row }; #This seems be deleting valid hits
}
#AS SOON AS THE FOLLOWING LINE IS COMPLETED THE DATA GETS LOST.
@query_results = sort { $$b[1] <=> $$a[1] } map ( [$_, $$id_results {$_} ], keys %$id_results );
This is the content of $query BEFORE that set of routines gets run.
SELECT count(*) FROM Links WHERE ID in (125,118,87) and (( CategoryID = "1"))

This is the content of $query AFTER that set of routines gets run.
SELECT ID FROM Links WHERE ID in (118) and (( CategoryID = "1"))

So, The query results before this point are fine, but once this set of routines gets run,
the query results get dropped from all the appropriate hits to just one
(something to do with delete $$id_results { $row }; - I think).
I temporarily commented out that line and my results were as expected but then I got this error:


Can't use an undefined value as an ARRAY reference at admin/Links/Search.pm line 935.

And now I'm way in over my head.

Can anyone take this from here? Or at least explain why this can't be fixed? I'll be happy to post whatever code I need to to get this up and working.

Thanks and peace.

Kyle




Subject Author Views Date
Thread Query + Field Searching - Please support bug fix klangan 3331 Sep 4, 2000, 10:01 AM
Thread Re: Query + Field Searching - Please support bug fix
pugdog 3232 Sep 4, 2000, 11:21 AM
Thread Re: Query + Field Searching - Please support bug fix
klangan 3209 Sep 5, 2000, 7:31 AM
Post Re: Query + Field Searching - Please support bug fix
pugdog 3198 Sep 5, 2000, 11:51 AM
Post Re: Query + Field Searching - Please support bug fix
Alex 3184 Sep 9, 2000, 11:40 AM