CMS MADE SIMPLE FORGE

Company Directory

 

[#8525] Search Action: Custom fields must be exact to return results; [expr] value="LIKE" ignored

avatar
Created By: Alane Cole (curlypinky)
Date Submitted: Mon Oct 15 22:48:17 -0400 2012

Assigned To: Robert Campbell (calguy1000)
Version: 1.15.1
CMSMS Version: 1.11.2
Severity: Major
Resolution: None
State: Open
Summary:
Search Action: Custom fields must be exact to return results; [expr] value="LIKE" ignored
Detailed Description:
I have company directory installed and I am attempting to setup the search form.
I have a custom textarea field that I would like to include in search. Using the
example in the New Search template I have:

<div class="row">
   <p class="col30">Short Description:</p>
   <p class="col70">
<input type="hidden" name="{$actionid}cdx_field[0][fldname]"
value="ShortDescription"/>{* hidden input for custom field name *}
<input type="text" name="{$actionid}cdx_field[0][fldval]" value=""/
size="20">{* text input for custom field value *}
<input type="hidden" name="{$actionid}cdx_field[0][expr]" value="LIKE"/>{*
hidden input for custom field expression *}
   </p>
 </div>

Using the LIKE expression is it correct to assume that this search form would
return results for any instances of the searched word found in the
ShortDescription field? At the moment this is not the case, any search must be
exact or you get no results. In the case of the textareas it is also including
the html markup - I tried setting an example company with "description" as the
value of the ShortDescription field. In the database it is stored as
<p>description</p>. Searching for "description" returned no results. Searching
for "<p>description</p>" returned the company.

I tried setting it to search a dropdown field and the user must type in a search
word that exactly matches the dropdown - ie the value of the dropdown is
"Hawaii-Only", If the user searches for "Hawaii" with LIKE set as the expr no
results are returned. If they type in "Hawaii-Only" it returns the expected
results.

Is this a bug?

Thank you,
Alane


History

Comments
avatar
Date: 2012-10-22 17:44
Posted By: John Moore (jomoweb)

I'm wondering about the same issue and just posted in the form about it.  I'm
not sure if there are other expressions to use or if this is a bug.  The example
says it is a substr search, so that should indicate that it would return partial
results.  It works great when it is an exact result though.
      
avatar
Date: 2012-10-24 16:18
Posted By: John Moore (jomoweb)

After much experimentation, I see that you can use = the same way as you use
LIKE and != will return everything but an exact match.  So, there is more to
this.  I have still yet to find a partial substr match method.