Gossamer Forum
Home : Products : DBMan : Customization :

Searching the DBMAN

Quote Reply
Searching the DBMAN
Just have a simple question: When using keywords for searching DBMAN does it work like this:

I enter:
iron vacation

Is DBMAN looking for any occurrence in any field that matches "iron vacation" or is it looking for both words iron and vacation anywhere in the field?

Can you do ORing in keyword search that is if I type in "iron vacation" (no quotes) can it look for either iron OR vacation in any field?

Gary
Quote Reply
Re: Searching the DBMAN In reply to
At present, if you enter "iron vacation" in a field named "keyword," the script will look for the phrase "iron vacation" in any field. I understand that Alex is planning to incorporate "or" searches in the next version of DBMan.

I made a little modification that works for me, but doesn't seem to work for other people. Try it if you'd like.

In db.cgi, sub query, look for

Code:
# Now let's build up all the regexpressions we will use. This saves the program
# from having to recompile the same regular expression every time.
foreach $field (@search_fields) {

Just below that, add

Code:
if ($in{$db_cols[$field]} =~ / or /i) {
$in{'re'} = 1;
$in{$db_cols[$field]} =~ s/ or /|/i;
}

You can then enter your search using "iron or vacation." Make sure you have a space before and after the "or" in both the code above and in your search term.

Let me know if it works for you.


------------------
JPD