Gossamer Forum
Home : Products : Links 2.0 : Customization :

Strange trouble with "AND" and search engine

Quote Reply
Strange trouble with "AND" and search engine
Hello

I believe that with "AND" connector,
search engine found only if all keywords are in the same field.

For example, if there is the following links in links.db :
Title = Gossamer
Description = Wonderfull scripts in perl

If i made a search with "AND" and the following keywords :
Gossamer + scripts + perl
The result will be : No matching records.

But if i made the search with "AND" and the following keywords : perl + wonderfull
The search engine will find the link Gossamer.

I don't find any post in forum customization to solve this problem, it will be very fine if the search engine with "AND" connector could find the results with keywords in different fields of links.db.

Thanks for your help

PS: if i was not clear, don't hesitate to tell me.


Quote Reply
Re: Strange trouble with "AND" and search engine In reply to
The AND connector is used to find matches that contain the queries on the left AND on the right in ANY fields that are being searched. Both MUST exist but not necessarily together (in the same field or different fields).

- Bobsie
bobsie@orphanage.com
http://goodstuff.orphanage.com/
Quote Reply
Re: Strange trouble with "AND" and search engine In reply to
Hello

Thanks for your reply Bobsie :o)

Could U tell me how configure links for the following result :

If the following link was in links.db :
- Title : Gossamer
- Description : Wonderfull CGI scripts.

If i made an advanced search by Keywords and "AND" with :
Gossamer wonderfull scripts

I'd like that the result is the link "Gossamer"

Thanks

ciao

PS: i've found a solution : put all keywords of title, description... in a keywords field, but it should exist a better solution...

Solution from this post : http://www.gossamer-threads.com/...ew=&sb=&vc=1
Quote Reply
Re: Strange trouble with "AND" and search engine In reply to
I've seen this question many times in the forum but am unable to find a working solution to search using AND across multiple fields. Any help? Thanks.
Quote Reply
Re: [cmuller] Strange trouble with "AND" and search engine In reply to
I imagine the easiest way to do this would be to join the searched fields into a single variable....
for example
Code:
open (DB, "admin/data/links.db") or die $!;
LINE: while (<DB>);
my $line = chomp($_);
my $string = join " ", (split "|", $line)[@search_fields];
foreach (@terms) {
next LINE if ($string !~ /$_/);
}
push @results, array_to_hash(split_decode($line));
}
close (DB);

this is ONLY an example, and has not been tested.

Philip
------------------
Limecat is not pleased.

Last edited by:

fuzzy thoughts: Oct 24, 2002, 10:08 PM