Learn2 only searches current page

The search function on learn.grav.com or the demos is really nice. For some reason I cannot get it to work.

I installed grav+ admin and then learn2 via gpm. I then added a few pages, sub pages and put them into categories, set them to published, etc.

Now when I search in the sidebar, it highlights the keyword on the page I’m currently on, however, it does not remove the pages that don’t contain the keyword from the list in the sidebar.
I am probably missing something but I cannot find out what.
Thanks in advance, have a nice day!

Do you have caching off? This searching process could take a few seconds if you have caching disabled. It should be very fast with caching enabled however.

Also check your XHR requests in your “Network” tab of your Web Inspector. Here you can see if the AJAX calls are returning successfully.

Thank you very much for the quick reply. I will try that out.

The calls appear to return successfully. I also have caching enabled. I also tried installing the skeleton of the theme. It does search pages that come with it but not the ones that I created. I suppose it’s something with the cache. I will try some different settings.

Still no luck. I’m almost sure it’s because it doesn’t create caches properly… You’ll find my site here

To be honest it’s kinda hard to tell with just 1 chapter and 1 docs page. Maybe create some more pages?

Also the navigation arrows are not working on yours either. So maybe you didn’t add the required:

taxonomy:
    category: docs

On all the pages???

BTW That would explain why everything is not working as expected. That taxonomy is needed to be set on all the pages and also defined in your user/config/site.yaml file.

You probably should start with the RTFM skeleton and remove the extra pages… Then just add the admin plugin with bin/gpm install admin

Yay, it’s working! This forum is amazing. Thanks so much!

I’m also experiencing the same issue. For some reason the search json only returns an array with one result “/”. Anyone have any ideas. All pages have are category: docs and the filter is set to use that.

@gazoo what web server are you using?

FYI we got this sorted on Gitter.