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 and advanced search forms always resulting in no results at all

April 17, 2011 1:15pm

Subscribe [7]
  • #1 / Apr 17, 2011 1:15pm

    Well, I give up. As soon as I try and add a simple search form (or an advanced form, for that matter) to a page, it just won’t work. If I type in a keyword I know is present in one of the entries, I get the message that there are no results to be found. If I search for a keyword that is in some title of an entry, the entry does get found.

    I have two channels that both contain a textarea field which has the “is searchable” checkbox checked. And that’s it. Having used this simple search option countless times in EE 1.x, I really don’t have a clue on what I could be doing wrong. And given the fact that three of my other problems had to do with crippled/bugged builds of Expression Engine 2.x, I’m really wondering if the problem is actually on my side… Any clues or suggestions would be highly appreciated.

    Michiel.

  • #2 / Apr 18, 2011 5:14am

    John Henry Donovan

    12339 posts

    Michiel,

    Can you share the template code you are using please?
    Make sure to make full use of the available parameters esp search_in= and where=

    {exp:search:simple_form channel="news" search_in="entries" show_expired="yes" show_future_entries="yes" status="open" where="all"}
    <label for="keywords">Search:</label>
    
    <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" /></p>
    <a href="http://{path=search/index}">Advanced Search</a>
    <input type="submit" value="submit" class="submit" /></p>
    {/exp:search:simple_form}
  • #3 / Apr 18, 2011 7:19am

    John,

    This is the code I am using right now, which does, as I mentioned, not give any results:

    {exp:search:simple_form channel="content_items" search_in="entries" where="all"}
    <label for="keywords">Search:</label>
    
    <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" /></p>
    <a href="http://{path=search/index}">Advanced Search</a> <input type="submit" value="submit" class="submit" /></p>
    {/exp:search:simple_form}

    The content_items channel has the following fields:

    Content summary     content_summary   Textarea  
    Content body     content_body   Textarea  
    Related images     related_images   Matrix  

    Content_body has the checkbox searchable checked, and there are about ten entries in the channel. Searches on title do return entries, other searches (content_body related) always end up empty.

  • #4 / Apr 19, 2011 6:30pm

    Sue Crocker

    26054 posts

    Hi, Michiel Papenhove.

    Are any of these entries in the future? And what about their status? Are they set to open?

  • #5 / Aug 23, 2011 11:56am

    laurentP

    1 posts

    a bit late on this, but I had recently the same problem and resolve it by including the status parameter in the search form tag:

    {exp:search:simple_form channel="news_channel" search_in="entries" where="all" result_page="site/search" status="open|otherStatus"}
         <input type="text" name="keywords" value="" id="keywords" size="17" />
         <input type="submit" value="Search">
    {/exp:search:simple_form}
  • #6 / Aug 23, 2011 12:05pm

    Maik Hoogkamer

    36 posts

    I am having the same problem with this code:

    {exp:search:simple_form channel="machines" no_result_page="search/no-results" result_page="search/index" show_expired="no" search_in="everywhere" results="50" status="open|hidden"}
    
            <input type="text" maxlength="130" id="keywords" name="keywords" value="" />
            
            <button class="submit" type="submit">
                <span>Search</span>
            </button>    
            
            <div class="clear"></div>
            
        {/exp:search:simple_form}

    When I search for some bogey string I get redirected to the no results page. But the search result page is not showing when I enter a string that should match one of the entries. Instead I get redirected to the 404 page.

    I do have a folder called search with an index file showing search results. Adding the status did not help.

    I can access /search/no-results without submitting the simple search form, but I can not access the results page. I get the same 404 page yet again.

    My .htaccess:

    <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>

    Currently running v2.2.2 - Build: date 20110801 with the latest MSM.

  • #7 / Aug 24, 2011 8:26am

    Maik Hoogkamer

    36 posts

    Any suggestions?  The ‘{exp:search:keywords}’ tag is also empty when I did enter some keywords. I’m also experiencing multiple instances of the same template within /search now. Surely this must be a bug.

    Screenshot here

    Edit: I can provide you an URL and login via PM if you wish.

  • #8 / Aug 24, 2011 8:57pm

    Dan Decker

    7338 posts

    MH1985,

    Sorry for the delay in a response to you. Since you are using .htaccess, I have to ask you to disable that for the time being and see if you are able to get search results returned vs. a 404. If you can get results without .htaccess, then we know that’s the holdup and we start sorting that out.

    Cheers,

  • #9 / Aug 25, 2011 4:45am

    Maik Hoogkamer

    36 posts

    Hi Dan,

    Unfortunately, putting the index.php back in place had no effect.
    I PM’ed you the URL to the testing environment and a CP login. Perhaps you can take a look since I am a bit lost.

  • #10 / Aug 25, 2011 10:14pm

    Dan Decker

    7338 posts

    MH1985,

    I saw your PM, and unfortunately I had to delete it. PMs are not a secure way to share that information with EllisLab and it’s outside of our Login Request workflow and tracking system. However, since you have requested we take a look, I’m happy to do so. Please be on the lookout for an email from me 😊

    Cheers,

  • #11 / Aug 26, 2011 4:48am

    Maik Hoogkamer

    36 posts

    MH1985,

    I saw your PM, and unfortunately I had to delete it. PMs are not a secure way to share that information with EllisLab and it’s outside of our Login Request workflow and tracking system. However, since you have requested we take a look, I’m happy to do so. Please be on the lookout for an email from me 😊

    Cheers,

    Thanks Dan, I filled out the form and you should have mail now 😊

  • #12 / Aug 26, 2011 11:29pm

    Dan Decker

    7338 posts

    MH1985,

    Just to let you know, we received your response. But if you would like to try a fix, there is fix outlined in this thread that might get you up and running.

    Cheers,

  • #13 / Aug 29, 2011 4:10am

    Maik Hoogkamer

    36 posts

    MH1985,

    Just to let you know, we received your response. But if you would like to try a fix, there is fix outlined in this thread that might get you up and running.

    Cheers,

    Thanks Dan, will take a look. However, I’m still experiencing duplicate templates.
    Could you look into this as well?

  • #14 / Aug 29, 2011 5:14pm

    Kevin Smith

    4784 posts

    Actually, I’ve seen this before, and I think the 404 page showing up when search results should appear is related to the duplicate templates. I don’t want to delete any templates, so I’ll let you do that. Go into the template group “search” and delete all the duplicates. Now try it again. Are you still experiencing issues? Are duplicate templates still being created or was that a one-time thing?

  • #15 / Aug 30, 2011 6:24am

    Maik Hoogkamer

    36 posts

    Actually, I’ve seen this before, and I think the 404 page showing up when search results should appear is related to the duplicate templates. I don’t want to delete any templates, so I’ll let you do that. Go into the template group “search” and delete all the duplicates. Now try it again. Are you still experiencing issues? Are duplicate templates still being created or was that a one-time thing?

    The index file is also duplicated and I can not remove that one from the CP, so I removed those manually from the table ‘exp_templates’. It did however not have any effect on the problem. The 404-page still get’s shown.

    Duplicate templates got created more than once. I can however not duplicate it now for some reason. I got the MSM switched off for now btw, so that should not interfere..

    Any other clues? I am approaching a deadline for this one soon :(

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

ExpressionEngine News!

#eecms, #events, #releases