First time using Low Search, having problems getting simple search to work
I keep getting no results
Steps I've taken so far:
- installed plugin
- created separate Collections for all sections of the site (projects, news, etc.)
- Built Index for each one
- used search form code below ( I currently have collection=projects for testing, but eventually I want to search all collections. Do I need to include all collections in that parameter, or not include the parameter at all?)
- used search results code below on search/results page
{exp:low_search:form collection="projects" query="{segment_3}" search_mode="all" result_page="search/results"}
<input type="text" name="keywords" placeholder="Search..." class="header_search" />
<input type="submit" value="" class="search_button"/>
{/exp:low_search:form}
{exp:low_search:results query="{segment_3}" limit="10"}
<div class="search_summary">
<h2><a href="{auto_path}">{title}</a></h2>
{low_search_excerpt}
</div>
{if no_results}
<p>Sorry, your query did not return any results. Check your spelling or try a different search term.</p>
{/if}
{/exp:low_search:results}
Replies
thatdeadpixel 8 Aug 2013 13:44
One more thing, what if I want to display the search terms on the results page above the results loop? would I need to add another results loop just to show the search terms and result count? Thanks for your help!
Low 8 Aug 2013 13:49
Have you added weight > 0 to the fields in your collection?
You can omit the collection="" parameter for searching all collections. Also, you needn't add the search_mode="" parameter if you're already using the default from the extension settings.
You can also turn on template debugging to see why/when the no_results bit is triggered.
You can use either {if count == 1} {low_search_keywords} {/if} in the loop, or use the {exp:low_search:keywords} tag to display the keywords: http://gotolow.com/addons/low-search/...
thatdeadpixel 8 Aug 2013 15:32
I had not set the weight above 0. Did that and removed the parameters that weren't needed and it worked great! Thanks for the quick support!
thatdeadpixel 8 Aug 2013 19:01
Woops, one more thing...Is there any kind of {auto_path} that can change based on the collection to use for the result links? Or are multiple conditionals the way to go? Thanks!
Low 8 Aug 2013 21:17
You can use any of the vars in the native channel:entries tag: http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#single-variable...
Something like comment_auto_path might help.