No results not firing and status="open" showing closed entries
Hello Mr Low,
I am putting in our new search - Awesome! The title says it all really. I have two issues:
• When I type in a string that isn't in the DB, the no results if statement isn't kicking in. It just shows nothing at all.
• I am also using Better Workflow (Which might be the cause), and I only want to show status="open". The results show everything.
I have tried the following to remedy the situation:
• Rebuilt index
• status="not closed|draft"
Here is what I have:
{exp:low_search:form collection="products" query="{segment_2}"
search_mode="all" result_page="search/index"
form_autocomplete="off"
form_class="well form-search"
}
<div class="input-append">
<input type="text" class="input-xxlarge search-query" name="keywords" id="keywords" placeholder="Search" value="{low_search_keywords}">
<button type="submit" name="submit" id="ajax_search_go" class="btn">Search</button>
</div>
{/exp:low_search:form}
<h3>Products</h3>
{exp:low_search:results query="{segment_2}" limit="12" status="not closed|draft"}
{sn:product_thumb}
{paginate}
<div class="clearfix"></div>
{pagination_links}
<div class="pagination">
<ul>
{first_page}
<li><a href="{pagination_url}"><<</a></li>
{/first_page}
{previous_page}
<li><a href="{pagination_url}"><</a></li>
{/previous_page}
{page}
<li><a href="{pagination_url}" {if current_page}class="active disabled" style="background: #d0d0d0"{/if}>{pagination_page_number}</a></li>
{/page}
{next_page}
<li><a href="{pagination_url}">></a></li>
{/next_page}
{last_page}
<li><a href="{pagination_url}">>></a></li>
{/last_page}
</ul>
</div>
{/pagination_links}{/paginate}
{if no_results}<h3>No results matched your query.</h3>{/if}
{/exp:low_search:results}
Am I being stupid again?
Cheers
Replies
Low 3 May 2013 14:15
What versions of Low Search and EE are you using? Can you copy/paste the template debugger info for search results that aren't working as expected here?
Having status="open" on the Results tag should definitely just show open entries; just like the native channel:entries tag.
Do you have the Low Search tags nested in other tags, maybe?
aurorameida 3 May 2013 14:52
I'm on: EE 2.5.5
LS: 2.3.0
I have two forms on the page. I'm using Stash and embedding the 'wrapper' which has one search in it and the other form is on the Search Results page (this one).
Nothing is nested inside another tag - apart from Stash-get. No matter which search I use, I still get the same issues.
I've put in the whole debugger.
TEMPLATE DEBUGGING
(0.000011 / 2.51MB) - Begin Template Processing -
(0.000117 / 2.51MB) URI: search/eyJjb2xsZWN0aW9uIjoicHJvZHVjdHMiLCJyZXN1bHRfcGFnZSI6InNlYXJjaFwvaW5kZXgiLCJzZWFyY2hfbW9kZSI6ImFsbCIsImtleXdvcmRzIjoid2VkZGluZyJ9
~~~~~~~~~~~~~~~~~
(0.094670 / 5.20MB) Tag: {exp:low_search:form collection="products" search_mode="all" result_page="search/index" form_autocomplete="off" form_class="navbar-search form-search pull-right"}
(0.094742 / 5.20MB) Closing Tag Found
(~~~~~~~~~~~~~~~~~
(0.095003 / 5.33MB) Module Tag: Low_search/form
~~~~~~~~~~~~~~~~~~
(0.102759 / 5.86MB) Calling Class/Method: Low_search/form
(0.102824 / 5.86MB) -> Class Called: Low_search
(0.104150 / 6.06MB) -> Method Called: form
(0.105070 / 6.10MB) Calling Extension Class/Method: Safecracker_ext/form_declaration_modify_data
(0.106279 / 6.12MB) Low Search: No or invalid query given
(0.106778 / 6.13MB) -> Data Returned
~~~~~~~~~~~~~~~~~
(0.135370 / 7.28MB) Tag: {exp:low_search:form collection="products" query="eyJjb2xsZWN0aW9uIjoicHJvZHVjdHMiLCJyZXN1bHRfcGFnZSI6InNlYXJjaFwvaW5kZXgiLCJzZWFyY2hfbW9kZSI6ImFsbCIsImtleXdvcmRzIjoid2VkZGluZyJ9" search_mode="all" result_page="search/index" form_autocomplete="off" form_class="well form-search" }
(0.135462 / 7.27MB) Closing Tag Found
(0.135548 / 7.28MB) Tag: {exp:low_search:results query="eyJjb2xsZWN0aW9uIjoicHJvZHVjdHMiLCJyZXN1bHRfcGFnZSI6InNlYXJjaFwvaW5kZXgiLCJzZWFyY2hfbW9kZSI6ImFsbCIsImtleXdvcmRzIjoid2VkZGluZyJ9" limit="12" status="not closed|draft"}
(0.135618 / 7.27MB) Closing Tag Found
(0.135689 / 7.28MB) Processing Tags
~~~~~~~~~~~~~~~~~
(0.135755 / 7.28MB) Module Tag: Low_search/form
(0.135775 / 7.28MB) Module Tag: Low_search/results
~~~~~~~~~~~~~~~~~
(0.167776 / 8.42MB) Calling Class/Method: Low_search/form
(0.167880 / 8.42MB) -> Class Called: Low_search
(0.168030 / 8.42MB) -> Method Called: form
(0.168380 / 8.44MB) Calling Extension Class/Method: Safecracker_ext/form_declaration_modify_data
(0.168718 / 8.43MB) Low Search: Valid query found
(0.169163 / 8.42MB) -> Data Returned
(0.169206 / 8.41MB) Calling Class/Method: Low_search/results
(0.169962 / 8.42MB) -> Class Called: Low_search
(0.170105 / 8.42MB) -> Method Called: results
(0.174319 / 8.56MB) Low Search: Starting search (fulltext)
(0.180115 / 8.83MB) Low Search: Applying collection modifier to search results
(0.182733 / 8.82MB) Low Search: Caching search results
(0.182776 / 8.82MB) Low Search: Setting fixed_order parameter
(0.183051 / 8.82MB) Low Search: Calling the channel module
~~~~~~~~~~~~~~~~~
(0.212367 / 10.27MB) Calling Extension Class/Method: Low_search_ext/channel_entries_query_result
(0.339892 / 9.93MB) Template Parsing Finished
Memory Usage: 10,665,728 bytes
Low 3 May 2013 14:58
Not seeing anything out of the ordinary in the search log. Will have to take a look myself. Can you send superadmin login credentials to hi at gotolow dot com?
aurorameida 3 May 2013 15:01
Its local at the mo. I'll push it up and send them over shortly.
Thanks for the speedy support!!
Low 3 May 2013 15:02
In the meantime, can you try if the no_results bit works if you this instead:
aurorameida 3 May 2013 15:03
Boom! One ticked off - Awesome. Thanks.
Low 3 May 2013 15:08
You can also try and change the low_search:results tag with the native channel:entries tag and see if that shows closed entries as well.
In any case, I'll take a look when you've pushed it to staging. Might be a bit later, as I'm on my way to an appointment at the moment.
aurorameida 3 May 2013 15:37
Thanks for the help Low. I seem to have fixed it. I think something was up with Better Workflow. I uninstalled and put it back on and all seems OK now. Very odd.
Thanks again.