[ic] Need exact matches in category not substring (WHERE = vs. WHERE LIKE %%)

John Young interchange-users@interchange.redhat.com
Tue Feb 5 20:51:06 2002


Hi, everyone.

If one were to take the Foundation demo with IC 4.8.3 using MySQL 3.23.44
(SQLDSN  dbi:mysql:dbname / perl 5.6.1 / Linux 2.4.10)
and add categories such that one had category names like:

Metal
Metal Discs

How does one avoid having both categories display when only
"Metal" is selected?


Essentially, I want results just like you would get from:

SELECT title FROM products WHERE category = "Metal";

but instead I am getting results like you would get from:

SELECT title FROM products WHERE category LIKE "%Metal%";

when using the default link from [cat-exec bar_link]cat[/cat-exec]
in foundation/templates/components/category_vertical.


I have looked at mv_exact_match, mv_unique, and mv_substring_match.
I am thinking that mv_substring_match is the answer, but no matter what
I try, I cannot avoid the behavior of having it match both categories.  I
am trying things like su=no, su=0, su=-1, mv_substring_match=no, yes, etc.
I have tried every combination I can think of both manually in the URL,
as well as modifying .../foundation/templates/components/category_vertical
and catalog_before.cfg.

I have tried simple tests such as manually editing the URL from:

http://servername/cgi-bin/foundation/scan/st=db/co=yes/sf=category/se=Metal/va=banner_image%3d/va=banner_text%3d.html

to
                                                                                
vvvvv
http://servername/cgi-bin/foundation/scan/st=db/co=yes/su=no/sf=category/se=Metal/va=banner_image%3d/va=banner_text%3d.html
                                                                                
^^^^^^
and various other versions using em, un, lf, ls, etc. (hey, I'm desperate), but
I
am unable to make any variants work. I've been combing through icdatabase.txt,
ictags.txt, icfoundation.txt, etc., the mail list archives, and even
Interpolate.pm,
Search.pm, Dbsearch.pm, DBI.pm, and Scan.pm.... but after two days I'm stumped.
DEBUG 1 with DataTrace 1 yields (among many other things):

2   <- FETCH= [ 'code' 'sel' 'name' 'which_page' 'sort' 'display_type' 'image'
'image_prop' 'banner_image' 'banner_text' 'link_type' 'url' 'ta
b' 'page' 'search' 'selector' 'link_template' ] at DBI.pm line 1146
    <- fetchrow_hashref= HASH(0x92f3d30)17keys row1 at DBI.pm line 1146

and in this case I think it should be 5 keys instead of 17 since "Metal" has 5
items and "Metal Discs" has 12 items.

I'm willing to do custom SQL queries if that will get me around this, but I
haven't figured out how to do that yet in this case.  I'd like to avoid renaming
the categories to completely unique names if at all possible.

Thanks for any suggestions/clarifications,
John