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.

Advanced Search Form only returning results from Titles

June 24, 2011 7:31am

Subscribe [3]
  • #1 / Jun 24, 2011 7:31am

    EWDC

    58 posts

    Hello there,
    I am currently adding search functionality to my sites but have encountered an issue which I can not work out. I have looked about and can’t seem to find a solution..

    I am using the example Advanced Search Form for now… however when I run a search I only seem to have returns from the Titles of entries. I have made sure that the custom field entries are set to searchable and that I have selected Search in Titles and Entries but do not receive any results. I have also tested this by using keywords from entries where a title search produces returns…

    Any help much appreciated… code below.

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
    “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
    <html >

    <head>
    <title>{lang:search}</title>

    <meta http-equiv=“content-type” content=“text/html; charset={charset}” />

    <link rel=‘stylesheet’ type=‘text/css’ media=‘all’ href=’{stylesheet=search/search_css}’ />
    <style type=‘text/css’ media=‘screen’>@import “{stylesheet=search/search_css}”;</style>

    </head>
    <body>

    <div id=‘pageheader’>
    <div class=“heading”>{lang:search_engine}</div>
    </div>

    <div id=“content”>

    <div class=‘breadcrumb’>
      {site_name} ›  {lang:search}
    </div>

    <div class=‘outerBorder’>
    <div class=‘tablePad’>

    {exp:search:advanced_form result_page="search/results" cat_style="nested" status="not Closed" }

    <table cellpadding=‘4’ cellspacing=‘6’ border=‘0’ width=‘100%’>
    <tr>
    <td width=“50%”>

    <fieldset class=“fieldset”>
    <legend>{lang:search_by_keyword}</legend>

    <input type=“text” class=“input” maxlength=“100” size=“40” name=“keywords” style=“width:100%;” />

    <div class=“default”>
    <select name=“search_in”>
    <option value=“titles” selected=“selected”>{lang:search_in_titles}</option>
    <option value=“entries”>{lang:search_in_entries}</option>
    <option value=“everywhere” >{lang:search_everywhere}</option>
    </select>

    </div>

    <div class=“default”>
    <select name=“where”>
    <option value=“exact” selected=“selected”>{lang:exact_phrase_match}</option>
    <option value=“any”>{lang:search_any_words}</option>
    <option value=“all” >{lang:search_all_words}</option>
    <option value=“word” >{lang:search_exact_word}</option>
    </select>
    </div>

    </fieldset>

    <div class=“default”>
    </div>

    <table cellpadding=‘0’ cellspacing=‘0’ border=‘0’>
    <tr>
    <td valign=“top”>

    <div class=“defaultBold”>{lang:weblogs}</div>

    <select id=“channel_id” name=‘channel_id[]’ class=‘multiselect’ size=‘12’ multiple=‘multiple’>
    {channel_names}
    </select>

    </td>
    <td valign=“top” width=“16”> </td>
    <td valign=“top”>

    <div class=“defaultBold”>{lang:categories}</div>

    <select name=‘cat_id[]’ size=‘12’  class=‘multiselect’ multiple=‘multiple’>
    <option value=‘all’ selected=“selected”>{lang:any_category}</option>
    </select>

    </td>
    </tr>
    </table>

    </td><td width=“50%” valign=“top”>


    <fieldset class=“fieldset”>
    <legend>{lang:search_by_member_name}</legend>

    <input type=“text” class=“input” maxlength=“100” size=“40” name=“member_name” style=“width:100%;” />
    <div class=“default”><input type=“checkbox” class=“checkbox” name=“exact_match” value=“y”  /> {lang:exact_name_match}</div>

    </fieldset>

    <div class=“default”>
    </div>


    <fieldset class=“fieldset”>
    <legend>{lang:search_entries_from}</legend>

    <select name=“date” [removed]>
    <option value=“0” selected=“selected”>{lang:any_date}</option>
    <option value=“1” >{lang:today_and}</option>
    <option value=“7” >{lang:this_week_and}</option>
    <option value=“30” >{lang:one_month_ago_and}</option>
    <option value=“90” >{lang:three_months_ago_and}</option>
    <option value=“180” >{lang:six_months_ago_and}</option>
    <option value=“365” >{lang:one_year_ago_and}</option>
    </select>

    <div class=“default”>
    <input type=‘radio’ name=‘date_order’ value=‘newer’ class=‘radio’ checked=“checked” /> {lang:newer}
    <input type=‘radio’ name=‘date_order’ value=‘older’ class=‘radio’ /> {lang:older}
    </div>

    </fieldset>

    <div class=“default”>
    </div>

    <fieldset class=“fieldset”>
    <legend>{lang:sort_results_by}</legend>

    <select name=“orderby”>
    <option value=“date” >{lang:date}</option>
    <option value=“title” >{lang:title}</option>
    <option value=“most_comments” >{lang:most_comments}</option>
    <option value=“recent_comment” >{lang:recent_comment}</option>
    </select>

    <div class=“default”>
    <input type=‘radio’ name=‘sort_order’ class=“radio” value=‘desc’ checked=“checked” /> {lang:descending}
    <input type=‘radio’ name=‘sort_order’ class=“radio” value=‘asc’ /> {lang:ascending}
    </div>
    </fieldset>

    </td>
    </tr>
    </table>


    <div class=‘searchSubmit’>

    <input type=‘submit’ value=‘Search’ class=‘submit’ />

    </div>

    {/exp:search:advanced_form}

    <div class=‘copyright’>Powered by ExpressionEngine</div>


    </div>
    </div>
    </div>

    </body>
    </html>

  • #2 / Jun 24, 2011 11:56am

    EWDC

    58 posts

    I have tried adding search_in=“everywhere” to the ExpressionEngine Advance Form Search Tags to see if I can isolate the problem. With this then I do receive returns from all entry fields, which is good. So it seems that the

    <div class=“default”>
    <select name=“search_in”>
    <option value=“titles” selected=“selected”>{lang:search_in_titles}</option>
    <option value=“entries”>{lang:search_in_entries}</option>
    <option value=“everywhere” >{lang:search_everywhere}</option>
    </select>

    ...is not amending the search as desired.

    Any ideas?

    Cheers,
    Edd

  • #3 / Jun 24, 2011 12:51pm

    Kurt Deutscher

    827 posts

    You may find this Bug Report helpful.

  • #4 / Jun 25, 2011 5:29pm

    Lisa Wess

    20502 posts

    Thanks, Kurt!

    EWDC - it appears that this is resolved in 2.2.  If you are on an earlier version, can you please try updating?  Alternatively, the bug fix includes a fix that you can add if you are not able to upgrade at this time.

    Thank you!

  • #5 / Jun 27, 2011 6:04am

    EWDC

    58 posts

    Thanks both, bug fix did not work for me… I will update to v 2.2 and let you know how I get on.
    Cheers,
    Edd

  • #6 / Jun 27, 2011 9:47pm

    Lisa Wess

    20502 posts

    Thanks Edd - please do let us know if 2.2 fixes this issue for you.

  • #7 / Jun 28, 2011 4:45am

    EWDC

    58 posts

    Have replaced the mod.search.php file with new version as a quick fix and filtering now working fine. Will be doing full update to v2.2 at the weekend. Thanks a lot.
    Edd

  • #8 / Jun 28, 2011 6:23pm

    Sue Crocker

    26054 posts

    Sounds good, Edd. In the mean time closing the thread. If you need to, start a new one based on this thread.

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

ExpressionEngine News!

#eecms, #events, #releases