Closed tobiasfabian closed 3 years ago
Ok, I think these are two issues to tackle:
$hits
but need to catch thatOk, first I can fix easily. Punctuation seems to be rather difficult to support with the Sqlite provider (with the FTS5 module underlying).
One way would be to strip punctuation from the query before processing. But then it would also match anything without the character.
For my current use case it would be fine to strip some special characters (e.g. ?
or !
).
E.g. $site->search('who?');
searches for who
(without ?
).
On the other hand it would be nice to have the ability to search for slugs. e.g. $site->search('notes/exploring-the-universe')
. So /
and -
shouldn’t be ignored. If it’s not possible to search for slugs it would be also fine.
I tried, but I don't manage to make it work with those characters. So I will make the search ignore them.
Describe the bug
I’m getting an error message
Undefined index: hits
when the search term contains a special character (e.g.-
,!
,?
).Steps to reproduce
or
Expected behavior
Should return search results for “tree-house” or “who?”.
Additional context
Specifications
BrowserBy the way, thank your for the awesome plugin! ❤️