Marcel Stäheli Posted March 17, 2018 Share Posted March 17, 2018 I have a search-page that searches through pages using a search term with the selector operator *= . My problem is that sometimes it finds no results eventhough the term I'm looking for is clearly on several pages. It depends on the search term and I can't find no pattern when it finds something and when not. If instead of *= I use the operator %= it always find the results as expected with the same search term. so: body*=zoe finds no results body%=zoe finds every page why is that? What exactly is the difference between the two? The documentation just mentions that %= is slower. I'm running the site on PW 3.0.95, but I also tested it on 3.0.88 with the same behaviour. Link to comment Share on other sites More sharing options...
horst Posted March 17, 2018 Share Posted March 17, 2018 has something to do with settings of your MySQL server. The string is only 3 chars long. Try someting with 5 chars for example. 2 Link to comment Share on other sites More sharing options...
Zeka Posted March 17, 2018 Share Posted March 17, 2018 From https://processwire.com/api/selectors/https://processwire.com/api/selectors/https://processwire.com/api/selectors/ Quote The *= and ~= rely upon MySQL fulltext indexes, which only index words of at least a certain length (configurable, but typically 4 characters). They also don't index common English words called stopwords. So while it's preferable to use *= and ~= for their speed, if you aren't getting the results you need, you should consider using %= instead (if you can handle the speed hit). 1 4 1 Link to comment Share on other sites More sharing options...
Marcel Stäheli Posted March 18, 2018 Author Share Posted March 18, 2018 I overlooked that part of the documentation somehow, sorry. Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now