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.

Simple Search no results error when there are results

October 15, 2012 11:03pm

Subscribe [2]
  • #1 / Oct 15, 2012 11:03pm

    Warble Media

    14 posts

    I have a Simple Search form in my template:

    {exp:search:simple_form channel="products" search_in="everywhere" result_page="products/search" form_class="search form-inline"}
        <div>
            <label for="keywords" class="visuallyhidden">Search</label>
            <input type="search" name="keywords" id="keywords" maxlength="100" placeholder="Search our store…">
            <button type="submit" class="btn">
                <i data-icon=""></i>
                <span class="visuallyhidden">Search</span>
            </button>
        </div>
    {/exp:search:simple_form}

    But when the form is submitted I always get the standard gray EE “Your search did not return any results.” error page.

    I have looked in the DB and the searches are being logged:

    id   site_id  member_id   screen_name     ip_address      search_date  search_type     search_terms
    19  1        1            Jeremy Worboys  127.0.0.1       1350354904   site            Bella

    and the row in the DB shows results are being found:

    search_id                           site_id  search_date  keywords    member_id   ip_address  total_results   per_page    query   custom_fields   result_page
    3a94a35005ffa2af06a6e43c6a9228ab    1        1350354904   Bella       1           127.0.0.1   11              50          [...]   [...]           products/search

    and if I take the SQL in the `query` column and run it I can confirm it is finding the 11 results.

    Let me know if you need any other details.

  • #2 / Oct 16, 2012 4:21pm

    Robin Sowell

    13255 posts

    Is it possible to link to the site in question?  If you’re getting no results, I’m wondering if the search_id is being interpreted wrong due to ... something.  That would give a ‘no results’, despite being results.

  • #3 / Oct 22, 2012 1:18am

    Warble Media

    14 posts

    Hey Robin,

    I didn’t get a notification that you replied. The dev site can be accessed at http://kidsonabington.jeremyw.me

  • #4 / Oct 22, 2012 9:42pm

    Shane Eckert

    7174 posts

    Hey Jeremy,

    Are you using a htaccess file?

    If you are, can you paste the contents in here?

    If not, I think we may need to get in a take a quick look.

    Thank you,

  • #5 / Oct 22, 2012 9:47pm

    Warble Media

    14 posts

    Hey Shane,

    Yes, it is a little long so I have put it here: http://pastebin.com/mGjgLSCg

  • #6 / Oct 22, 2012 10:03pm

    Shane Eckert

    7174 posts

    Hey Jeremy,

    Wow! That’s quite a file.

    Just for testing, what happens if you set that aside for a second and then try the search. Does that fix it?

    You may need to actually replace your current htaccess with this one because you have removed index.php.

    <IfModule mod_rewrite.c>
            RewriteEngine On
    
            # Removes index.php
            RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ /index.php/$1 [L]
    
            # If 404s, "No Input File" or every URL returns the same thing
            # make it /index.php?/$1 above (add the question mark)
    </IfModule>

    Please let me know the results.

    Cheers,

  • #7 / Oct 22, 2012 10:09pm

    Warble Media

    14 posts

    Just tried your code with and without the question mark. Still no luck.

  • #8 / Oct 23, 2012 5:29pm

    Shane Eckert

    7174 posts

    Hey Jeremy,

    I thought for sure it was your htaccess file.

    I would like to get in and take a look.

    Please be on the lookout for an email from EllisLab.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases