0

The search is returning too many results and repeating the same result entries more then once.

I have a second collection set up almost exactly the same which doesn't do this.

Any idea what is going on? Thanks for looking.

Search box code

  {exp:low_search:form result_page="publications/pub_results"}
     <fieldset>
       <input type="search" name="keywords" id="keywords"/>
       <button type="submit">Search Publications</button>
     </fieldset>
  {/exp:low_search:form}

Results page code (with mark up simplified)

    {exp:low_search:results query="{segment_3}" limit="10" collection="publications_c" search_mode="auto"}
  {if count ==  1}

           <p>{pub_year}</p>

              <h4 style="margin-left:12px; margin-bottom:0px; margin-top:0px; padding-top:0px;"><a href="{url_title}">{full_title}.</a></h4> 


                   {/if}

             {if count == total_results}</ol>{/if}
                {if no_results}<p>No search results. Check your spelling or try a different search term.</p>{/if}
              {/exp:low_search:results}
0
1

To quote the docs:

[P]arameters can be applied in two ways: as input fields in a Form, or as hard-coded parameters in the Results or URL tag.

That means the Form tag doesn't accept any filter parameters, like collection and search_mode, which are part of the Keywords filter. So try moving those parameters to the Results tag instead.

Also, the parameter name is not a valid on the Form tag. If you're trying to set an html attribute to the form-tag, use form_name instead.

Edit: After investigation, it turned out the Results tag was nested inside a channel:entries tag, and the code inside the Results tag was wrapped inside a {if count == 1} conditional. The problem was solved after these issues were addressed.

3
  • I updated the <form? tags etc. I still getting same sort of results. What might you suggest? Do you know is there a current beginners tutorial with examples out there perhaps. Feeling a bit lost. Thanks!! – Eric Jan 28 '15 at 0:26
  • updated the question above – Eric Jan 28 '15 at 0:53
  • If the updated code is giving you unexpected results, please submit a support request over at the official Low support forums, along with version info and template debugger output. – Low Jan 28 '15 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.