Skip to content

"==" does not work on field search in Pro Search #4741

@studionigh

Description

@studionigh

I have created a website much like the ExpressionEngine Add-On page. (EE 7.5.8, PHP: 7.4.33)I built the site following the article at EE University here: https://u.expressionengine.com/article/advanced-searching-with-low-search-and-ajax. I followed the article that was written using the Low Search but it works great with the Pro Search. I created a Multi-Select field just as they did for “add_on_compatibility”. They had 7 check boxes (one for each version of EE) My field has about 16 different check boxes for “add_on_compatibility” items. The problem is in the search filtering, the “==” is treated like “*=” or Contains, on this line of code:

{if pro_search_search:add_on_compatibility =="4"}checked{/if}

So if I click on a checkbox that is 4 or 14, the search results show both (because both include a 4). if I try a Tilda ~ “matches”, it does not work. Here is the code to show a checkbox:

<li>
   <input 
    type="checkbox"
    name="search:add_on_compatibility[]"
    data-action-uncheck="show-all-compatibility"
    id="EE4" 
    value="4" 
    {if pro_search_search:add_on_compatibility =="4"}checked{/if}
    />
    <label for="EE4">EE 4</label>
</li>

If there are more than 9 check boxes in the add_on_compatibility field, it will be a problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions