We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Simple Search only searching titles with fields set to searchable and search_in="everywhere"

How Do I?

gprobst's avatar
gprobst
32 posts
6 months ago
gprobst's avatar gprobst

Updated: Just updated to EE 7.1.6, and that did not resolve the issue.

I’m using EE 7.1.5 and have a Simple Search set up for my ‘blog_posts’ channel that works fine for searching titles but ignores the content of my blog_story_content (a textarea field), which has the searchable option set to on.

My Simple Search markup is as follows:

{exp:search:simple_form id="searchForm" channel="blog_posts" result_page="blog/search-results" no_result_page="blog/no-results" search_in="everywhere" where="all"}
 <label for="keywords">Search for:</label>
 <div id="search-input">
    <input type="text" name="keywords" id="keywords" maxlength="100" size="20">
    <label class="screenReaderOnly" for="searchSubmit">Search</label>
    <input id="searchSubmit" class="searchSubmit" name="searchSubmit" type="button" value="search" />
 </div>
{/exp:search:simple_form}

Things I have tried:

  • adding new test entries with specific keywords to do test searches on
  • toggling the searchable option in the blog_story_content off and back on again
  • rebuilding the search index

I’m assuming there’s probably something obvious that I’m missing, but I just can’t seem to figure out. Any help would be appreciated!

       
Andy McCormick's avatar
Andy McCormick
316 posts
about 6 months ago
Andy McCormick's avatar Andy McCormick

Do you have some Javascript connected to #searchSubmit to submit your search form or any other JS connected to your form on submit? When I try to use the search button you have, it doesn’t natively work to submit the form.

Aside from that, I don’t see any issues. Can you try to locally set up a blank site using the default theme and see if the simple search within that works fine for you (it seems to work well for me in all my testing). It uses similar parameters that you’re trying to use.

From default theme:

{exp:search:simple_form
      form_class='search'
      channel='{layout:ch}'
      search_in='everywhere'
      where='all'
      result_page='{layout:p_url}/search'
      no_result_page='{layout:p_url}/no-results'
      results='5'
     }
      <input type="text" name="keywords" id="keywords" value="" placeholder="Type keywords, hit enter">
     {/exp:search:simple_form}
       
gprobst's avatar
gprobst
32 posts
about 6 months ago
gprobst's avatar gprobst

Yes, the submit button won’t work without javascript, because I had it set to type=”button.” Using type=”submit” without js yields the same results of only titles being returned in a search.

So,

{exp:search:simple_form id="searchForm" channel="blog_posts" result_page="blog/search-results" no_result_page="blog/no-results" search_in="everywhere" where="all"}
 <label for="keywords">Search for:</label>
 <div id="search-input">
    <input type="text" name="keywords" id="keywords" maxlength="100" size="20">
    <label class="screenReaderOnly" for="searchSubmit">Search</label>
    <input type="submit" id="searchSubmit" class="searchSubmit" name="searchSubmit" value="search" />
 </div>
{/exp:search:simple_form}

still returns only entries with the keyword in the title.

I can set up a blank site a give a it a try. Thanks!

       
gprobst's avatar
gprobst
32 posts
about 6 months ago
gprobst's avatar gprobst

I set up an instance of the Default site and the search function on there seems to be working as expected.

       
gprobst's avatar
gprobst
32 posts
about 6 months ago
gprobst's avatar gprobst

FWIW, I also tried modifying the working example from the default site on my site (replacing the channel and results pages) and am still seeing the same behavior.

{exp:search:simple_form
 form_class='search'
 channel='blog_posts'
 search_in='everywhere'
 where='all'
 result_page='blog/search-results'
 no_result_page='blog/no-results'
 results='5'
}
 <input type="text" name="keywords" id="keywords" value="" placeholder="Type keywords, hit enter">
{/exp:search:simple_form}
       
gprobst's avatar
gprobst
32 posts
4 months ago
gprobst's avatar gprobst

Updated to 7.2.0 and am still having this same problem. I’ve now created multiple new test sites on the same web server and have no issues even when setting up channels, fields, and templates essentially verbatim to how I have them set up on the site with the search functionality issue. Anyone have any other suggestions of how to troubleshoot this? I don’t want to have to rebuild this entire site, if I can avoid it.

       
Andy McCormick's avatar
Andy McCormick
316 posts
4 months ago
Andy McCormick's avatar Andy McCormick

gprobst. Contact support at support@expressionengine.com and mention that Andy said to send this in. I’ll ping you back there and have you send a copy of your DB so I can try and troubleshoot what’s going on.

       
gprobst's avatar
gprobst
32 posts
4 months ago
gprobst's avatar gprobst

Thanks, Andy. I’ve sent a message to support@expressionengine.com.

       
Robin Sowell's avatar
Robin Sowell
13,187 posts
4 months ago
Robin Sowell's avatar Robin Sowell

Well ick- it appears to be a bug: https://github.com/ExpressionEngine/ExpressionEngine/issues/1851 . It’s a bit obscure since you need a lot of searchable fields for it to crop up.

We’ll see about getting that fixed up asap!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.