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

Search Module

How Do I?

Syd's avatar
Syd
8 posts
4 years ago
Syd's avatar Syd

Hello.

I am trying to use the simple search module, so far without success.

The code that I am using is the following:

{exp:search:simple_form channel="home"}

<input type=”text” name=”keywords” id=”keywords” value=”” search_in=”everywhere” size=”18” maxlength=”100” placeholder=”Type keywords, then click ‘Search’”>

<input type=”submit” value=”Search” class=”submit”>

{/exp:search:simple_form}

I am getting the message

“Search Results:

Your search did not return any results.

Return to Previous Page”

I am clearly missing something here.

I am using version 5.3.2.

I would be grateful for any help with this.

Thanks,

Harry.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
4 years ago
Robin Sowell's avatar Robin Sowell

You were close- I think the problem is you’ve got search_in in the form field rather than as a parameter. Try:

{exp:search:simple_form channel="home" search_in="everywhere"}

<input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" placeholder="Type keywords, then click ‘Search’">

<input type="submit" value="Search" class="submit">

{/exp:search:simple_form}

See docs for details. on the form- and keep in mind, fields have to be set to be searchable or the tag won’t look in them. If something isn’t coming back and you think it should, double check the field settings.

       
Syd's avatar
Syd
8 posts
4 years ago
Syd's avatar Syd

Thanks, Robin.

I checked the field settings. These were not set to “search”, so have now set them.

I then tried your suggestion of putting search_in as a parameter, but I then get the message

“Error

The page you requested was not found.”

When I put it back in the form field, I again get

“Your search did not return any results.”

I’m new to EE, so am probably missing something vital.

Thanks.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
4 years ago
Robin Sowell's avatar Robin Sowell

What template_group/template is the search results tag on? I suspect it’s guessing where to end up. That, or maybe there are no matches in the ‘home’ channel.

Try this:

{exp:search:simple_form channel="home" search_in="everywhere" result_page="news/searches"}

<input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" placeholder="Type keywords, then click ‘Search’">

<input type="submit" value="Search" class="submit">

{/exp:search:simple_form}

See this bit: result_page=”news/searches”

changed it to the template_group/template where you have your search results tag.

       
Syd's avatar
Syd
8 posts
4 years ago
Syd's avatar Syd

Thank you! I had assumed that the result_page parameter was optional. I tried putting this in, and for the first time got some positive search results.

I am having problems with my page disappearing, but I think I’m on the way - thanks for your help!

       

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.