MyBB Community Forums
[Rejected] Hyphens in search - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+----- Forum: Rejected (https://community.mybb.com/forum-184.html)
+----- Thread: [Rejected] Hyphens in search (/thread-162469.html)



Hyphens in search - SteelCurtain - 2014-11-07

Not sure if this is a bug or just something that was simply left out for a reason. When you search for something that has a hyphen, the search comes back with no results. I've tested it with a thread that contained a hyphen and zero results.


RE: Hyphens in search - Destroy666 - 2014-11-07

Well, more info would be nice:
1. What's your search input? Also, what type of search is it (entire post or just titles)?
2. What's the title and content of the post that should be found?
3. Do you have fulltext searching enabled in your forum's settings? What's your DB type?


RE: Hyphens in search - SteelCurtain - 2014-11-08

(2014-11-07, 11:13 PM)Destroy666 Wrote: Well, more info would be nice:
1. What's your search input? Also, what type of search is it (entire post or just titles)?
2. What's the title and content of the post that should be found?
3. Do you have fulltext searching enabled in your forum's settings? What's your DB type?


Sorry for being so vague....

1. Not sure what you mean by search input. The search is just titles.

2. The search keyword was Winston-Salem which should have a few results.

3. Fulltext searching is enabled. DB: MySQL 5.5.37 UTF-8 Unicode.


Hope this helps


RE: Hyphens in search - Destroy666 - 2014-11-08

(2014-11-08, 12:58 PM)SteelCurtain Wrote: 1. Not sure what you mean by search input.

The text you're looking for, you specified it below. But you didn't specify 2. - the whole post/title.

(2014-11-08, 12:58 PM)SteelCurtain Wrote: 3. Fulltext searching is enabled.

I think this is most likely the cause. Try turning fulltext searching off temporarily and check if that works.


RE: Hyphens in search - SteelCurtain - 2014-11-09

(2014-11-08, 01:10 PM)Destroy666 Wrote:
(2014-11-08, 12:58 PM)SteelCurtain Wrote: 1. Not sure what you mean by search input.

The text you're looking for, you specified it below. But you didn't specify 2. - the whole post/title.


(2014-11-08, 12:58 PM)SteelCurtain Wrote: 3. Fulltext searching is enabled.

I think this is most likely the cause. Try turning fulltext searching off temporarily and check if that works.

You are correct. When I turned off Fulltext, hyphens are now included in the search.


RE: Hyphens in search - dragonexpert - 2014-11-09

I believe it is because hyphens are a special character since they can be used to define a range. Try running the query in PHPMyAdmin and have a \ before the hyphen and see if results are correct.


RE: Hyphens in search - Jones H - 2015-06-25

I'm not sure whether we can do much about this if it's a special character. We allow searches with "and" and "or" too afair so special characters aren't escaped.


RE: Hyphens in search - Destroy666 - 2015-07-06

(2014-11-09, 03:31 PM)dragonexpert Wrote: I believe it is because hyphens are a special character since they can be used to define a range.  Try running the query in PHPMyAdmin and have a \ before the hyphen and see if results are correct.

AFAIR hyphens are not considered word characters at all for some reason and escaping them with \ is not a solution, rather using "" to enclose the whole search phrase. Which will break searches with all special characters/keywords, including and/or mentioned above.

If there's no other easy way to solve this, I guess we can skip this issue. Or just add info about limited allowed word characters to the full text setting's description (it shoud be extended with proper DB info too, now there's only useless "(depending on your database)"..)


RE: Hyphens in search - Jones H - 2016-11-21

What's with this now? Can we reject this? Anyone else from the team with some input?