1

We are getting a really odd result when doing certain site searches.

The search function loads a completely blank page when we search for the word Anaerobic; Looking at the source some of the template code is rendered but not all of it.

  • Anaerobic – blank page
  • Anaerobic digestion – blank page
  • Anaerobic Digestion Development Centre – returns results fine

Failed Search Terms

https://www.uk-cpi.com/search/results?q=Anaerobic+digestion

https://www.uk-cpi.com/search/results?q=Anaerobic

Working Search Terms

https://www.uk-cpi.com/search/results?q=Anaerobic+Digestion+Development+Centre

It seems to work fine locally - does anyone have any idea what could be causing the issue?

Thanks in advance,

Dan

2

Are you doing any caching on this site? If you haven't tried already, clear all the caches and run the query again in Utilities > Clear Caches

I did some test searches, and it appeared to be the exact search term that's failing rather than content that's returned by that search term, which makes me wonder about a corrupt cache.

  • I cleared the cache and this didn't have any effect. – Dan Lee Sep 16 at 8:32
1

Did you check the craft logs under storage/logs/ ? There are quite a few, try doing the following to find out in which logs new stuff is being written when trying your search:

Linux

  1. Check file-dates for all of your storage/logs files
# go to storage/logs
cd storage/logs
# view all infos of all the files here
ls -al *
# example output
# -rw-r--r-- 1 your-user domain-user  8452020 Sep 11 11:34 web.log

  1. Now do a Request which reults in a faulty response. and then
  2. re-check the dates on last-changed for all your logs, once you find out in which it's being written

  3. run tail -f path/to/file.log and then

  4. watch the output of the console once you do another request.

Windows

  1. Simply take a look at the last-changed date on all files through your Explorer
  2. Do a faulty-response Request
  3. Check the logs which were edited most recently and either
  4. a: delete/move said log for it to generate a new one on the next request
    b: Simply take a look at the bottom lines and try to see at which point the output of your faulty-response request beings and take a look there.

If you're able to resolve it through that output, that's great! If not or you need any other type of help, feel free to respond here and/or open a new question.

  • Thanks for the details response - there doesn't seem to be anything showing in the logs. – Dan Lee Sep 16 at 8:41
  • Hmm well there's one other thing you can try, you could forcefully add *searchterm* asterisks around the search term so as to make craft search quite a bit more leniently (though likely also a decent bit less efficiently). I tested it out myself and I got lots of results even for the 2nd failed search term you mention in your question. To reiterate basically: https://www.uk-cpi.com/search/results?q=Anaerobic to https://www.uk-cpi.com/search/results?q=*Anaerobic* Search Docs: docs.craftcms.com/v3/searching.html#supported-syntaxes – Campiotti Sep 20 at 9:36

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.