Conversation
supportI ve noticed that with latest versions when trying to search words in exact order putting them into quotes doesn’t worked as before. Is this a bug or a misconfiguration?
Is this in the live search or the regular search? Quotes have annoyingly been the biggest fight I’ve been doing with the search engine! Are you able to point me to a few examples on your site so I can do a bit of checking?
It’s on the regular search. You can try it with any two words: “red house” or “big car”. The results are not returning posts where these two words are present in that exact order as it should be. What it’s expected is that if I put “red house” without quotes then there are results where any of the words appear in no particular order and in any place of the text, and if I put the two words between quotes, then the search should return ONLY posts where these two words are one after the other and next to the other. But right now is not working that way. This reply was modified 7 months, 3 weeks ago by pobrehablador .
I’ll do some checking. I think there is a bug with the quotes but I’m not sure what exactly. Will need to dig through the code and debug. On quotes limiting to only posts with the two words if they are in quotes, it isn’t directly possible with mySQL FULLTEXT (or at least I haven’t found a way). Typically mySQL has prioritised the results but filled others.
I have the boolean mode activated in my settings if it helps.
I’ve filed a bug report here: https://github.com/WebberZone/better-search/issues/130 I might delay the 4.2.1 release for this as I think it’s a fundamental issue. I’ll test with and without Boolean. It should work in both cases.
Well, may be you should make some verification on your code before creating the SQL query. If there is words between quotes, then remove the quotes and make the query like this: SELECT * FROM posts WHERE MATCH(col_name) AGAINST (‘”happy dog”‘ IN BOOLEAN MODE); where row_name is the name of the column indexed with FULLTEXT. Just ensure to not to place the quotes two times with your query. May be if you can show me the code I could help you
I’ve released 4.2.1 that includes the fix we discussed in the GitHub issue.
Is this in the live search or the regular search? Quotes have annoyingly been the biggest fight I’ve been doing with the search engine! Are you able to point me to a few examples on your site so I can do a bit of checking?
It’s on the regular search. You can try it with any two words: “red house” or “big car”. The results are not returning posts where these two words are present in that exact order as it should be. What it’s expected is that if I put “red house” without quotes then there are results where any of the words appear in no particular order and in any place of the text, and if I put the two words between quotes, then the search should return ONLY posts where these two words are one after the other and next to the other. But right now is not working that way. This reply was modified 7 months, 3 weeks ago by pobrehablador .
I’ll do some checking. I think there is a bug with the quotes but I’m not sure what exactly. Will need to dig through the code and debug. On quotes limiting to only posts with the two words if they are in quotes, it isn’t directly possible with mySQL FULLTEXT (or at least I haven’t found a way). Typically mySQL has prioritised the results but filled others.
I have the boolean mode activated in my settings if it helps.
I’ve filed a bug report here: https://github.com/WebberZone/better-search/issues/130 I might delay the 4.2.1 release for this as I think it’s a fundamental issue. I’ll test with and without Boolean. It should work in both cases.
Well, may be you should make some verification on your code before creating the SQL query. If there is words between quotes, then remove the quotes and make the query like this: SELECT * FROM posts WHERE MATCH(col_name) AGAINST (‘”happy dog”‘ IN BOOLEAN MODE); where row_name is the name of the column indexed with FULLTEXT. Just ensure to not to place the quotes two times with your query. May be if you can show me the code I could help you
I’ve released 4.2.1 that includes the fix we discussed in the GitHub issue.