ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search multiple fields only

August 10, 2010 5:34pm

Subscribe [0]
  • #1 / Aug 10, 2010 5:34pm

    Aaron Post

    15 posts

    And yes, I am a search newbie.

    The Problem:
    I want it to search only my Projects weblog and I only want it to search the projectsector and marketsector fields?

    I have seen numerous post but no resolution to this problem, while I don’t think its unique I am unable to find anything that actually works including the super search module from solspace.

    Trying to search just the 2 fields but based on what I am reading this cannot be done?  What I have so far (not even close to working but I had to start somewhere I guess.

    {exp:search:advanced_form weblog="projects" status="open" search_in="projectsector" where="word" }

    <div class="defaultBold">{lang:categories}</div>
    
    <select name='projectsector'>
    
        <option value="none">Business Line Sector</option>    
    
        {exp:weblog:categories weblog="services" parent_only="yes" style="none"}
                        
        <option name="projectsector" value="{category_name}">{category_name}</option>    
                            
        {/exp:weblog:categories} 
    
    </select>
    
    <select name='marketsector'>
    
        <option value="none">Select Market Sector</option>    
    
        {exp:weblog:categories weblog="swcaprojects" style="none"}
                        
        <option name="marketsector" value="{category_name}">{category_name}</option>
        
        {/exp:weblog:categories} 
    
    </select>
    
    
    <input type='submit' value='Search' class='submit' />
    
    {/exp:search:advanced_form}
  • #2 / Aug 16, 2010 5:01am

    Aaron Post

    15 posts

    Got it, I used the query module guess that seems easy now that I look at it.

    {exp:query sql="SELECT DISTINCT exp_weblog_data.entry_id, exp_weblog_titles.title,
     exp_weblog_data.field_id_7 FROM `exp_weblog_data`, `exp_weblog_titles` WHERE `field_id_10` 
    LIKE '%xxxxxxxxxx%' AND `field_id_51` LIKE '%xxxxxxxxxx%' AND exp_weblog_data.entry_id = 
    exp_weblog_titles.entry_id;"}

    Had to use the % sign because the field has numerous other items in it.


    Just realized that I am having a conversation with myself?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases