All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Problem with Low Search and Ce Cache

hrvoje66 24 Feb 2014 11:50 problem, complete

Hi,

Using
- MEMCACHE option for Ce Cache.
- Low Search with NOT encoding queries

When I first search something, the result page displays normally, but then every search after that just shows the result from first search.

Also, Low Search Filters on search results page have no effect, no matter what i select in the filters, I always get the first search result. The URL changes but the content stays the same.

Tried setting "exp:ce_cache:escape" around filters. Then when a filter is selected, the following PHP Errors appear:

A PHP Error was encountered
Severity: Warning
Message: array_merge() [function.array-merge]: Argument #2 is not an array
Filename: low_search/mod.low_search.php
Line Number: 1572

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/arhiva2s/public_html/systemxtr/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 408

For testing purposes, I tried setting the "exp:ce_cache:escape" around "You searched for (low_search_keywords)" and around the "exp:low_search:results" but all that just brings more PHP Errors and weird behaviour.

Additionally, I tried setting the Ce Cache ID parameter to {segment_2} where the search parameters are but instead of "results?loose_ends=no&search_mode=all&keywords=test+search" it just shows "results".
Then I tried using the (exp:low_search:keywords format="url") as the ID parameter but with no luck.

Can you advise on how to fix this or recommend the best way to approach caching of the low search results while also being able to have filters on the search results page?

Thanks

Replies

  1. Low 24 Feb 2014 12:21

    When not encoding queries, the query string is appended to the URI. The query string itself is not part of the segments, so having {segment_2} as results is correct behaviour.

    The PHP error, again, should not appear. To fix, open mod.low_search.php, look up line #1570 which reads

    if (ee()->TMPL->tagparts[1] != 'results')


    Change that to

    if (ee()->TMPL->tagparts[1] != 'results' && is_array($this->params->tagparams))


    Which should get rid of it.

    But I'm not sure this will help the issue with CE Cache. That's a result of using the GET vars. You can always go back to the encoded queries.

  2. hrvoje66 24 Feb 2014 13:27

    Thanks for the fix.

    In the end we decided to go with encoded queries option and its working ok like this.