[ic] Coordinate search problem

Jamie Neil interchange-users@icdevgroup.org
Thu Apr 3 21:38:00 2003


I'm trying to customise the foundation search component to allow optional
searching within a selected category or manufacturer. I've got it partially
working, but it doesn't seem to be behaving properly :(

The search box has two drop down lists for product (catagory) and brand
(manufacturer) which are built dynamically from the corresponing tables, and
a text box for typing in search strings.

If the text box is left empty and a catagory and/or manufacturer is selected
then the search works as expected (all products in that catagory from that
manufacturer). If both catagory and manufacturer are set to "all" (option
returns "") then all items are returned.

However, as soon as anything is entered into the text box (e.g. Penny) then
I get "Sorry, no matches for  x|y|z." where x is the catagory, y is the
manufacturer and z is the search string.

If I then change the search field for the text box from "*" to
"description", it seems to start working. So if I select "Nails", "All
Manufacturers" and type in "Penny" it comes back with the 3 items with
"Penny" in the description. But if I type in "pen" it doesn't work, even
though I have substring matching switched on.

I've also tried many other combinations of options with varying degrees of
success, but I cannot get it to reliably find all (or sometimes any)
matching items.

Is this a bug or is there something wrong with my syntax (or logic)?

Here's my code:

          <form method="post" action="[area search]">
          <td valign="top">
            <INPUT TYPE=hidden NAME=mv_session_id VALUE="[data session id]">
            <INPUT TYPE=hidden NAME=mv_coordinate VALUE=1>
            <INPUT TYPE=hidden NAME=mv_searchtype VALUE=db>
            <INPUT TYPE=hidden NAME=mv_matchlimit VALUE=[control matches
10]>
            <INPUT TYPE=hidden NAME=mv_substring_match VALUE=1>
            <INPUT TYPE=hidden NAME=mv_search_map VALUE="
              mv_searchspec=product
              mv_searchspec=brand
              mv_searchspec=searchstring
            ">
            <INPUT TYPE=hidden NAME=mv_search_field VALUE="category">
            <INPUT TYPE=hidden NAME=mv_search_field VALUE="manufacturer">
            <INPUT TYPE=hidden NAME=mv_search_field VALUE="*">
            <INPUT TYPE=hidden NAME=mv_column_op VALUE=eq>
            <INPUT TYPE=hidden NAME=mv_column_op VALUE=eq>
            <INPUT TYPE=hidden NAME=mv_column_op VALUE=rm>
            <select class="boxmenusmall" name="product">
              <option value="" selected>All Products</option>
              [loop
                option=product
                search="
                  fi=cat
                  st=db
                  ra=yes
                  rf=name
                  tf=name
                  un=1
                "
              ]
              <option>[loop-code]</option>
              [/loop]
            </select>
            <select class="boxmenusmall" name="brand">
              <option value="" selected>All Brands</option>
              [loop
                option=brand
                search="
                  fi=manufacturers
                  st=db
                  ra=yes
                  rf=name
                  tf=name
                  un=1
                "
              ]
              <option>[loop-code]</option>
              [/loop]
            </select>
            <img src="/images/spacer.gif" width="1" height="25"><br>
            <input type="text" name="searchstring" size="15" maxlength="30"
class="boxmenu" value="">
            <input type="image" name="go" src="/images/play.gif" width="16"
height="15" alt="go" >
            <img src="/images/spacer.gif" width="1" height="25"><br>
            <a href="[area advancedsearch]"
class="boxmenusmall">Advanced</a>
          </td>
          </form>

Any assistance gratefully recieved.

Thanks,

Jamie Neil