Non encoded result_page issue, plus encoded urls eventually resulting in 403 Forbidden error
Hi Low
As you can tell from the title of this topic, I'm dealing with 2 issues. Let's take the first one:
Non encoded result_page parameter
I've been turning off url encoding in the extension settings whilst developing this site in order to get a feel for whether I'm doing things right without necessary clicking on all the links Low Search produces.
I have the result_page parameter in my exp:low_search:form and that's working as expected. However, all the links in my exp:low_search:results output show the default result page path as set in the extension. When I turn encoded urls back on, this corrects itself.
403 Forbidden error due to url being too long
So with encoding back on, I'm using the exp:low_search:filters tag within my exp:low_search:results in order to change the sort order etc. The problem is that every time I click on one of these links to resort, the url doubles in size, eventually resulting in a 403 forbidden error.
Any idea what this could be? I'm using EE 2.5.2 and Low Search 2.3.1.
Here's my code:
{exp:low_search:results collection="properties" query="{segment_2}" status="not closed|draft|off-market|golden" site_id="1"}
{if count == 1}
<p>Total {absolute_results}</p>
{exp:low_search:filters query="{segment_2}"}
<a href="{if low_search_orderby_sort == "property_price|asc"}{low_search:url orderby_sort='property_price|desc'}{if:else}{low_search:url orderby_sort='property_price|asc'}{/if}" title="Sort by Price">Price</a>
{/exp:low_search:filters}
{/if}
<!-- rest of output here -->
{/exp:low_search:results}
Cheers
Jim
Replies
Low 27 Aug 2013 09:15
You don't need to add the Filters tag in the Results tag. It will work without it as well. And when not encoding the queries, you'll need to add the result_page parameter to the URL tag as well.
I can see the behaviour you mention re: long URL. That's specifically when you nest URL tags inside the Results tag. Take them out, and it should work. Nevertheless, it's a bug that I need to fix. :)
Jim P 27 Aug 2013 10:09
Thanks Low! Your reply has sorted out my issues :-).
One other question, I'm switching to Low Search because
a) I'm not satisfied with the performance of SuperSearch and
b) I'm able to utilise Varnish cache with Low Search's encoded urls (which is amazing!!)
However, when I bypass varnish I'm not really noticing much of a performance boost over SuperSearch. This surprised me and makes me wonder whether I'm doing anything wrong. Any advice?
Cheers
Jim
Low 27 Aug 2013 11:05
The performance for keyword searches in Low Search should be fast, as that uses the fulltext index. Any other filtering is probably equal to using the native channel:entries tag, as most of that filtering is native anyway.
So, depending on your search form, Low Search can be faster than Super Search (and especially native search), if you're using keyword searches.
Jim P 27 Aug 2013 11:30
Thanks for clearing that up Low. Still, the advantages of being able to use Varnish with Low Search vastly outweigh anything else that's currently available, so I'm more than happy.