"DV-125.jpg" is not considered a valid search item

Geiri

Active member
I have a thread named "DV-125" and I have photos named "DV-125.jpg"

Nothing is coming up in my search because - and . are not searchable or the whole "DV-125.jpg" is not searchable.
 
Unfortunately I think you're just running into limitations with the default MySQL full-text search.

There are certain trade-offs required to ensure it returns relevant results in a performant way so certain words/characters are stripped out. This is unfortunately a limitation of the default search within MySQL.

If these kinds of issues are common for you then you'd likely benefit from XenForo Enhanced Search. This uses elasticsearch instead of MySQL FT search and is much better suited for either larger sites, or sites that require searching for terms such as this which may otherwise be filtered out by MySQL.
 
I can't speak or account for the behaviour in VB5 but typically the default ft_min_word_len value (for MyISAM full-text search) is 4. Assuming this is on the same MySQL server as VB was, that value likely hasn't changed from what it was.

Perhaps VB5 uses InnoDB full-text search which defaults to 3 or was set lower.

Anyway, regardless of how it works in VB5 there may be adjustments to make which will make this work in XF.

This MySQL query will tell you what the current value is:

SQL:
SHOW VARIABLES LIKE 'ft_min_word%';

You can set this to 2 if you want - bear in mind this may mean searches are less relevant and may take longer - by editing your server's my.cnf file:

Code:
[mysqld]
ft_min_word_len = 2

For this to take effect you will then need to do two things in XF:

1. Rebuild the search index under Admin > Tools > Rebuild caches
2. Set the searchMinWordLength option to 2

This seems to work in my testing:

1638550847830.webp

Note that this search query actually becomes DV 125 meaning it contains two terms/words DV and 125. If you set the values to 3 instead of 2 it would discount DV entirely but will find results containing 125.
 
Back
Top Bottom