PontusHorn / Pico-Search

Simple search feature for pages in your Pico CMS
MIT License
22 stars 4 forks source link

Are files in categories folder searched? #6

Closed paulomorais1981 closed 5 years ago

paulomorais1981 commented 5 years ago

HI,

I've created search.md, search.twig and the form in index.twig just exactly this readme says.

But when I click search or when i write "localhost:8000/search/something", I get back to home, always.

My posts are on subfolders of content folder. I've done this to create the categories. It's all working fine, except the search form.

Does the search form searches inside the categories folder or i have to set something up?

Thx

paulomorais1981 commented 5 years ago

Well, i've tested so much the plugin, but instead of what readme says, i can't access the search by typing localhost/search/foobar, but only if localhost/?search/foobar.

The ? can't be forgotten. So, the search form is not working, and I don't know yet how to fix it.

PontusHorn commented 5 years ago

Hey! Sorry to hear about the problem.

I haven't been working actively with Pico for a while, but I just tried doing a fresh Pico install and added the plugin according to the readme, and it all seems to work well for me. What version of Pico are you using? I believe Pico 1.0 introduced some changes to the URL handling, so if you're using 0.9 or lower that might be the issue.

evansmith110610 commented 5 years ago

I'm using Pico 2.0 and having the same issue.

PontusHorn commented 5 years ago

I can't reproduce this problem. Is URL rewriting working in the rest of your Pico installation? That is, do your other URLs look like domain.com/sub/page or domain.com/?sub/page?

jonwgeorge commented 5 years ago

Hey @PontusHorn,

Just adding my voice that I am also experiencing this issue, but slightly different. I can't search at all. I just get my 404 page when trying to search. If I go to /search directly, I will display every page on my site. Additionally, the search_excludes option does not work in my config.yml file.

Using Pico 2.0.4, via manual install.

What can I collect or provide to help troubleshoot this?

paulomorais1981 commented 5 years ago

Hey @jonwgeorge

I think it can be a mod_rewrite and AllowOverride's apache2 thing. In the other forum, i've found a solution, read this:

https://github.com/picocms/Pico/issues/495

jonwgeorge commented 5 years ago

My files mod_rewrite is working fine. I don't think I have access to AllowOverride with my host, but I would assume it is already enabled.

paulomorais1981 commented 5 years ago

I solved the problem with this solution:

Looks like the plugin requires URL rewriting to be enabled. Please refer to http://picocms.org/docs/#url-rewriting to enable URL rewriting.

PontusHorn commented 5 years ago

Sorry for the delay on this.

I adjusted the search form example in the readme slightly to account for URL rewriting being disabled. Does that cover everyone's issues?

PontusHorn commented 5 years ago

I'll take that as a yes and close this, but feel free to open a new issue if you're still experiencing issues.