Searching 3-letter words

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
penlix
Registered User
Posts: 44
Joined: Thu Oct 19, 2006 12:22 pm
Contact:

Searching 3-letter words

Post by penlix »

Hi,

we have this forum on www.vcdc.gr/forum which as recently updated to phpBB 3.0.4.

We are having issues with our search feature, when searching for 3-letter-words, such as PNG, FLA etc, and given that the forum is design-oriented, that's quite a major bug..

Is this fixable somehow?

Thank you in advance!
Last edited by ric323 on Thu Mar 12, 2009 11:15 am, edited 1 time in total.
Reason: Topic icon changed
User avatar
ric323
Former Team Member
Posts: 22910
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Searching 3-letter words

Post by ric323 »

It's not a bug, just a setting.
Go into your ACP, "search settings", and adjust the "Min characters indexed by search:" field.
You will need to rebuild your search index to enable posts made before this change to be indexed correctly.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions
User avatar
penlix
Registered User
Posts: 44
Joined: Thu Oct 19, 2006 12:22 pm
Contact:

Re: Searching 3-letter words

Post by penlix »

Many many thanks!
User avatar
penlix
Registered User
Posts: 44
Joined: Thu Oct 19, 2006 12:22 pm
Contact:

Re: Searching 3-letter words

Post by penlix »

Hi, the problem stays, I re-built the search index, and set 3 at the "Min characters indexed by search".

However, still I don't get any results for 3-letter words.

Am I doing something obviously wrong?
adiant
Registered User
Posts: 134
Joined: Sat Jul 05, 2008 1:48 am

Re: Searching 3-letter words

Post by adiant »

The Common Words setting is also worth investigating:
Common word threshold:
Words which are contained in a greater percentage of all posts will be regarded as common. Common words are ignored in search queries. Set to zero to disable. Only takes effect if there are more than 100 posts. If you want words that are currently regarded as common to be reconsidered you have to recreate the index.
This is located just below the Minimum Word Length value you were modifying.
User avatar
penlix
Registered User
Posts: 44
Joined: Thu Oct 19, 2006 12:22 pm
Contact:

Re: Searching 3-letter words

Post by penlix »

Thanks adiant, I'll give this a try as well.
User avatar
penlix
Registered User
Posts: 44
Joined: Thu Oct 19, 2006 12:22 pm
Contact:

Re: Searching 3-letter words

Post by penlix »

adiant wrote:This is located just below the Minimum Word Length value you were modifying.
I found out that this was set to 0%, and the indexing was done with this setting.

What else could I look into?

Thanks for the input.
User avatar
penlix
Registered User
Posts: 44
Joined: Thu Oct 19, 2006 12:22 pm
Contact:

Re: Searching 3-letter words

Post by penlix »

Just to update, out of desperation and on a whim, I tried a Minimum Word Length of 2, rebuilt the index and tried a search of a three letter word, but without success.
User avatar
ric323
Former Team Member
Posts: 22910
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Searching 3-letter words

Post by ric323 »

How many posts are there on your board?
Indexing can take a while, and it's entirely possible it hasn't finished doing it yet!
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions
User avatar
penlix
Registered User
Posts: 44
Joined: Thu Oct 19, 2006 12:22 pm
Contact:

Re: Searching 3-letter words

Post by penlix »

Hi, how can it not be done, since I was getting the message that the indexing was complete.

However, we have quite a lot of posts, but the indexing wasn't lasting even 5 minutes at each time. Does this sound wrong?

On the Search Index page it says Total amount of indexed posts: 172376
adiant
Registered User
Posts: 134
Joined: Sat Jul 05, 2008 1:48 am

Re: Searching 3-letter words

Post by adiant »

I just turned Searching on in Version 3 for the first time this morning. I too cannot get a search to work for any three letter word.

BUT, when I do a search on this forum (phpbb.com) for a three letter word, it works perfectly.

The one thing no one has asked penlix is what Search Backend is he using. So, let me be the first to do so.

Penlix: on the same Search Settings page, could you please check the setting for Search Backend? Is it fulltext mysql or fulltext native?

For the record, mine is fulltext mysql.
adiant
Registered User
Posts: 134
Joined: Sat Jul 05, 2008 1:48 am

Re: Searching 3-letter words

Post by adiant »

I just did a fresh install of phpBB 3.0.4 with the initial one post forum. I added a second post to the forum with several three letter words. A search with the fulltext native backend worked.

I then built a fulltext mysql search index. And switched the search backend to fulltext mysql. Searchs for three letter words failed. Searches for four letter words worked fine.

I have now reported this through the Bug Tracker (# 42895).
User avatar
fastreplies
I've Been Banned!
Posts: 372
Joined: Wed Dec 26, 2007 7:08 am

Re: Searching 3-letter words

Post by fastreplies »

3 letters word search have nothing to do with phpBB

Limitation comes from MySQL structural inability to look up for 3 letters words

;)

fastreplies
adiant
Registered User
Posts: 134
Joined: Sat Jul 05, 2008 1:48 am

Re: Searching 3-letter words

Post by adiant »

Since writing the above, I found this in the MySQL 5.0 manual:
The minimum and maximum lengths of words to be indexed are defined by the ft_min_word_len and ft_max_word_len system variables. The default minimum value is four characters; the default maximum is version dependent. If you change either value, you must rebuild your FULLTEXT indexes. For example, if you want three-character words to be searchable, you can set the ft_min_word_len variable by putting the following lines in an option file:
[mysqld]
ft_min_word_len=3
Then you must restart the server and rebuild your FULLTEXT indexes.
I then returned to the ACP Search Settings page and, despite being here a dozen times before, this is the first time I noticed that Min and Max Characters Indexed by Search are fields in a section entitled Fulltext Native.

I have now updated my Bug Report, indicating that this is not a Bug. Though it does offer the opportunity to improve the ACP Search Settings page by adding the Min and Max fields to the Fulltext MySQL section, as display-only values of the ft_min_word_len and ft_max_word_len system variables. Possibly with a note explaining that these values can only be changed for all users of the MySQL server, by restarting the database server. Hopefully, this would alert the 99% of phpBB users who run on shared hosting that changing these values isn't something their host is going to do. This is especially important now that most shared hosting companies are installing Resource Monitors that terminate any process as long-running and processor-intensive as rebuilding a Fulltext Native search index for anything but the smallest of forums. That leaves Fulltext MySQL as the only practical alternative for nearly every phpBB user. Short of turning off Searching.
sandpiper_flyer
Registered User
Posts: 27
Joined: Tue Jun 24, 2008 1:09 am

The Solution

Post by sandpiper_flyer »

To enable 3-letter word searches;
to point out the solution for those who haven't been following the thread

ACP > General Tab > Search Settings
Search backend: Fulltext Native
Min characters indexed by search: 3

ACP > Maintenance Tab > Search Index
Delete Index ... Create Index *(same buttons)

Thank you fastreplies and adiant for pointing out the mySQL limit. Where can we submit recommendation for this information to be included in the ACP as I'm sure it will save many Admin the trouble of searching for a solution.
Locked

Return to “[3.0.x] Support Forum”