Gossamer Forum
Home : Products : DBMan : Customization :

Boolean Mod Big Problem

Quote Reply
Boolean Mod Big Problem
Hello!

I have installed Boolean v1.1 Mod (Developed by Leisurelee) It works perfect! But..

When I (completely incidentally) have looked at the source code of page with search results, I found, that each "bolded" word placed in set of repeating HTML-tags.
For example, when you search for "Windows", you receive following :

<B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B>Windows</B></B
></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B>

At the same time general (native) DBMan-Search works entirely correctly. When you search for "Windows", you receive:

<B>Windows</B>.

All other Mod's and features works correctly too. I think problem in Mod.

I placed Boolean Mod code exactly in compliance with manual ( http://webmagic.hypermart.net/.../db/text/boolean.txt or http://www.gossamer-threads.com/...guest=1977269#137261 ).

I noticed, that "Number of Identical Unnecessary Tags" (identical repeated needless tags - e.g. - <B>,<B>,<B>, ...) = "Number of Database Definition Fields" - "3"
I have several databases. If db.cfg contain 25 fields (from 0 to 24), "Number of Identical Unnecessary Tags" = 25 - 3 = 22
If db.cfg contain 22 fields (from 0 to 21), "Number of Identical Unnecessary Tags" = 22 - 3 = 19

May be this observation may help..?

Is it possible to get rid of unnecessary tags?

Thanks a lot for any help!

----------------------------------------

Link to website (in development): http://www.italent.ru/cgi-bin/talent/db.cgi

db.cgi file: http://www.italent.ru/db_cgi.txt

Last edited by:

FDI: Nov 15, 2002, 9:14 AM
Quote Reply
Re: [FDI] Boolean Mod Big Problem In reply to
One more link to db.cgi: http://www.italent.ru/db_cgi.html
Quote Reply
Re: [FDI] Boolean Mod Big Problem In reply to
Try turning off bold within your .cfg file.

$db_bold =0;

When this is turned on it can cause problems with many mods.

If you still have problems you might try removing the bold tags in the section of the boolean mod for bolding the results.

Hope this helps

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/

Last edited by:

LoisC: Nov 15, 2002, 1:57 PM
Quote Reply
Re: [LoisC] Boolean Mod Big Problem In reply to
Hi, LoisC!

Thank you for support.

I tried. It not works. I mean, examined solutions just disable "Bold the results" feature.
In both case ("turning off $db_bold" and "removing bold tags from Mod") search feature as usual works perfect, but search results not bolded at all.

Is there any other way ?
Quote Reply
Re: [FDI] Boolean Mod Big Problem In reply to
What happens when you just keep the bold codes within the mod itself .. and not set within the .cfg file?

I never use bold turned on and haven't really needed the search results to be bold so I have no experience.

Perhaps there are some references in the FAQ that would help to provide some insight. Or someone else may help to provide a solution.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Boolean Mod Big Problem In reply to
This just disable (turn off) "Bold the results" for all type of search (both for general DBMan-search and for Boolean search).
The Search itself works fine. But search results is not bold.
There is no necessary (one pair) bold tags (<B></B>). There is no unnecessary (some pairs) bold tags (<B><B><B></B></B></B>). Nothing. Just a plain text.

Last edited by:

FDI: Nov 16, 2002, 6:02 AM
Quote Reply
Re: [FDI] Boolean Mod Big Problem In reply to
I'm not clear with what you are saying in your last post. Within the boolean mod there are lines starting with the section "#Bold the results" and starts with:

$hits[field + .... which then has at the end:

"<b>$2</B>",ge;

If you keep this it should, I would think, just add the bolding for the search results for the boolean search. Is that where it is generating all the extra tags?

Have you searched the forum for all the threads relating to this mod to see if you could find any references to the bolding?

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Boolean Mod Big Problem In reply to
In last post I mean (briefly, in reply to your corresponding post), that:
The Search itself works fine. But search results is not bold.

------------------------------------------

In reply to your last post:

I removed the section "#Bold the results" (the part for the Boolean Mod)
I mean, this code:

if($in{'bool'}) {
for $m (1 .. $k) {
$hits[$field + $offset] =~ s,(<[^>]+>)|($regexp_bold[$m]),defined($1) ? $1 : "<B>$2</B>",ge;
@html_search_form;
}
} else {

}

And I keep ALL other the Boolean mod code.

Now. Boolean Search works best (as usual), but if I search for some words it bolded only one result (only one word) per search results page. Other resuts (other words) on this page is not bold.
Quote Reply
Re: [FDI] Boolean Mod Big Problem In reply to
I'm sorry I never meant to say you should remove this section:

# Bold the results
if ($db_bold and $in{'view_records'}) {
for $i (0 .. (($#hits+1) / ($#db_cols+1))- 1) {
$offset = $i * ($#db_cols+1);
foreach $field (@search_fields) {
if($in{'bool'}) {
for $m (1 .. $k) {
$hits[$field + $offset] =~ s,(<[^>]+>)|($regexp_bold[$m]),defined($1) ? $1 : "<B>$2</B>",ge;
@html_search_form;
}
} else {
$hits[$field + $offset] =~ s,(<[^>]+> )|($regexp_bold[$field]),defined($1) ? $1 : "<B>$2</B>",ge;
}
}
}
}
return ("ok", @hits);
}


Rather that you should try removing the bold tags within the lines:

$hits[$field + $offset] =~ s,(<[^>]+>)|($regexp_bold[$m]),defined($1) ? $1 : "<B>$2</B>",ge;

Like this:

$hits[$field + $offset] =~ s,(<[^>]+>)|($regexp_bold[$m]),defined($1) ? $1 : "$2",ge;

to then see if it adds all the extra bold tags or not.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Boolean Mod Big Problem In reply to
I'm sorry too. Probably I had a mistake.
So before I deleted the bold tags within the following string:

$hits[$field + $offset] =~ s,(<[^>]+>)|($regexp_bold[$m]),defined($1) ? $1 : "<B>$2</B>",ge;

search results looks like:

<B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B><B>Windows</B></B
></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B></B>

Now, when I deleted the bold tags:

$hits[$field + $offset] =~ s,(<[^>]+>)|($regexp_bold[$m]),defined($1) ? $1 : "$2",ge;

the results looks like:

Windows

No bold tags at all.
Quote Reply
Re: [FDI] Boolean Mod Big Problem In reply to
It must have something to do with the

,ge;

part of the line then. Not being a programmer I don't know what that does .. the 'g' may be for global but I'm not sure about the 'e'. Perhaps searching on a perl site would provide some insight. Or you can post a question in the perl programming forum and see if anyone would be able to provide some insight.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/