Open calvez opened 6 years ago
The learn skeleton has a special overriden version of the search box that makes an ajax call via simplesearch and then uses the json response to filer the sidebar for appropriate topics (see the learn.getgrav.org site).
You can use the search landing page and it works if you go here: https://tozsdeabc.bet.hu/search?query=index
but the search box is not intentionally targeting that.
You could add a link to 'advanced search' like we do on learn.getgrav.org, and that goes to a dedicated landing page, however note that we've swapped out simplesearch for tntsearch plugin now as it's much more powerful and is faster when there is more content.
Is it possible to make it select-able if one wants to use simplesearch or tntsearch under /search? I tried to get simplesearch working (search query is entered wrong in url - not working) under /search but couldn't it get to work. Changing code is not a good thing I think, as it might be overwritten in future.
FYI (might be a temporary workaround for you if you do the same):
I thought my pull-request (156) fixed the simple search results when used via .../search
, but it got reverted as it broke other things apparently (so inform yourself about that).
And yes, updates will revert your change should you make it.
I fixed my issue with search not working, when embedded in a page (it worked on its own, but not when the form was embedded in a page).
Bear in mind my fix applies to the Gantry5 Framework & Hydrogen theme, but it might work for you.
The issue was that the Javascript was not loading.
I change the page.html.twig template to include this piece of code on line 65
{%- do gantry.document.addScript(url('/DxChange/user/plugins/simplesearch/js/simplesearch.js'), 11, 'footer') -%}
This results in the javascript being loaded in the HTML (check the code source) near the footer
Subsequently the search works ! Et voila :-)
PS: replace "DXChange" in the URL with your website name
Hello!
I'm just not able to make it work. :( Grav and simple search are the latest version, the simplesearch.yaml is here:
you can check the site here
search queries looks this way
And if you include the /search as the config suggest it's ok: check
I already tried evey suggestion. The js is loaded, the index is ok, the results are perfect....
Searchbox looks like this:
The searchbox twig is basically the same as original: