Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Boolean Search

Quote Reply
Boolean Search
Please, explain, how it is possible "turn on" Boolean Search ("and", "or") in DBMan SQL 2.
There are a lot of demos in package, but any of them does not maintain boolean search.
There is no example. I've lost a lot of time, but nothing has understood.

Thank you.

Paul
Quote Reply
Re: [Skiff] Boolean Search In reply to
The 'and' is used by the default, you can pass in ma=1 for 'or'.

TheStone.

B.
Quote Reply
Re: [TheStone] Boolean Search In reply to
Hi, TheStone!

Thanks a lot for all your answers on my questions!

Yes, I know, that it's possible to search for different words in different fields with ma=1, but i need to search for any words and any different records just from one keyword field (as it is made in this forum, e.g. in the bottom of this page or on the "Search Posts" page).

Now, if I enter:

BookTitle1

in "Keyword" field (or in "Title" field), I get Record with appropriate value, but if I enter:

BookTitle1 BookTitle2

I get nothing.

Is there any way to search for "All words" or "Any words" in DBMan SQL just from one keyword field?

Links SQL and Gossamer Forum both have this simple possibility, but DBMan SQL ..?

Paul
Quote Reply
Re: [Skiff] Boolean Search In reply to
So, you should use the WordSearch plugin Wink

TheStone.

B.
Quote Reply
Re: [TheStone] Boolean Search In reply to
Yaahooooo !!!

I mean, it works perfect. Thank you, TheStone.
I thought of adding possibility to search with "AND" (not only with "OR") condition using your plugin.

May be there is more efficient way (if yes, let me know), but I've made the following:
1. Copied out the file WordSearch.pm and named it WordSearchAND.pm
2. Replaced "OR" with "AND", and "ws" with "wsand".
3. Installed WordSearchAND with the help of Plugin Wizard (Author = TheStone, v1.0, sure Cool ).
4. On the search page added two forms. One for OR condition (input name=ws) (col= .., col= .. in hidden fields), second for AND condition (input name=wsand) (col= .., col= .. in pulldown menu).

Probably, I'll change something in HTML, but even now works excellently!

Thanks again!

Paul
Quote Reply
Re: [Skiff] Boolean Search In reply to
Hi,

You need to make a little change in WordSearch.pm:

# Create the condition object
require GT::SQL::Condition;
my $cond = new GT::SQL::Condition('OR');

TO:

# Create the condition object
require GT::SQL::Condition;
my $ma = ( $IN->param('ma') ) ? 'OR' : 'AND';
my $cond = new GT::SQL::Condition($ma);

Now, you can pass in ma=1

TheStone.

B.
Quote Reply
Re: [TheStone] Boolean Search In reply to
Why? Why I'm not a Programmer?

It's so simple, that I never would guess!

Paul