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:
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!
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}
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!
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}
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.
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!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.