Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Using "OR" if the "AND" Boolean setting produces no results.

Quote Reply
Using "OR" if the "AND" Boolean setting produces no results.
How would one go about setting up a search so that if Zero results are found using "AND", to search again using an "OR" search. I am using Glinks 3.2.0. Any help is appreciated.
Quote Reply
Re: [ranjan] Using "OR" if the "AND" Boolean setting produces no results. In reply to
Hi,

Mmm.. thats pretty hard. It would require a plugin, to hook into the search hook, and then see if no results were found (and a "query" was defined) ... and then if not pass in an OR condition.

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [ranjan] Using "OR" if the "AND" Boolean setting produces no results. In reply to
Hi,

I am not sure if this is ok for you but it works for this case. Please just add the below code into your search.html template

Code:
<%if term and bool eq 'and'%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="refresh" content="0; url=<%db_cgi_url%>/search.cgi?query=<%term%>;bool=or;substring=<%if substing%><%substing%><%endif%><%if mh%>;mh=<%mh%><%endif%>">
</head>
<body>
<p>Trying to search again!</p>
</body>
</html>
<%else%>
.... current search .template

<%endif%>

Cheers,

Dat

Scripts installation and plugin creation
Plugins
Quote Reply
Re: [tandat] Using "OR" if the "AND" Boolean setting produces no results. In reply to
Good idea - why didn't I think of that Tongue

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates