XF 2.2 Search forums not in the node list

Davyc

Well-known member
I have three forums that are not included in the regular node list - in the settings I unchecked the 'Display in the node list'

1634720860980.webp

I have used the node urls to create access in a drop menu and there is no requirement or need to duplicate the entry access points.

My issue is that because these forums are not included in the node list, they cannot be searched and that is causing a problem that I would like some kind of resolution to. So, to that end, is there a means to get these included in the search parameters without showing them in the node list because, as I have pointed out, this would be a redundant course of action in duplication.

As an aside, it may be prudent to display a warning that such an action will exclude them from the search facility and/or add an option to include these forums in the search parameters.

With thanks
 
Solution
Can you check the engine type of table xf_search_index?

This should be MyISAM (this is how XenForo does create the table and it is the only supported configuration), if it is InnoDB that might explain what you are experiencing.
Checked and the result is:

So I have changed it back to 4 and the result is exactly the same, so the returned results ARE inconsistent otherwise either everything searched for would show or no results for anything would be returned, especially when both settings are now the same.

Some titles show up, others do not. I've done this on a whole host of titles, so there must be something not working correctly.

[...]

For example, if I search 'Deep Purple' or 'Black Sabbath' the results for those bands are returned.
Keywords are long enough and not stopwords => Does work

If I search for AC/DC (and there are albums for that band listed) there are no results returned.
The two keywords ac and dc are too short => Does not work = No results

OK a little more investigating shows the search results are inconsistent. For example if I search for
Metal Rendez-vous
I get a returned result:
1634727286469-png.258883
The keywords are long enough and not stopwords => Does work

If I search for Too fast for love I get this
1634727402752-png.258885
The keywords too and for are too short (and are stopwords) => Does not work as expected.

With your initial setting (minimum length = 2 in XenForo), XenForo would generate a query like
Code:
SELECT search_index.content_type, search_index.content_id FROM xf_search_index AS search_index WHERE MATCH(search_index.title, search_index.message, search_index.metadata) AGAINST ('+too +fast +for +love' IN BOOLEAN MODE) ORDER BY search_index.item_date DESC LIMIT 200

This does not yield any results as there no records that could match keywords for and too (as they are less than 4 characters).
If those were left out you should get results.

So I don't really see any inconsistencies here, but let's see what answers you will get from the ticket :)

Which is completely useless as people will be searching by what they know. For example if I were visiting the forum and I wanted to find out if Master of the Moon was on the site I would type that into the search box only find out that it's not there (according to the search). There is no way someone will just type Master, or Master Moon.
Use XFES = Problem solved.

It is impossible to "fix" this issue with MySQL FT, especially if you can't adjust the MySQL config.

The search should ignore words less than 4 characters strip them out automatically so that the remaining valid words stay and results can be shown.
This should happen if the minumum length configured in XF does match the MySQL setting.
 
Last edited:
It's a limitation of MySQL search, not XF.

As someone who had jumped ship from IPS I find it strange how this limitation was not present in their software using the same MYSQL as I am using on XF. So it begs the question what are they doing differently with their search feature that XF is not - I'm not out to make waves, but I am finding the issue somewhat frustrating.

Unfortunately because I am on shared hosting I cannot install Elasticsearch otherwise I'd have it in a heartbeat. I could move to a VPS but my knowledge of such things could be written on a postage stamp lol.
 
Excuse my simplistic way of thinking but can the search not be made to strip out the 'stop' words of less than 4 characters and reinitialise the search with those words removed so that 'Master of the Moon' would be reworded by the system automatically into 'Master Moon' and therefore return the result? Would that be possible?
 
I never said threads from forums hidden in the node list would not appear in search results, I said forums hidden in the node list will not appear on the search form :)
Good point
hich is completely useless as people will be searching by what they know.

I tested this on one of my forums and no problem. I mentions the short words, but still finds the post.:

Screenshot 2021-10-20 at 15.18.59.webp

Screenshot 2021-10-20 at 15.18.08.webp

I'm presuming that the search ignores the / as a character as the name AC/DC with the slash is five characters long lol.

No, I think it sees two x two-letter words.
 
I tested this on one of my forums and no problem:
Now this is interesting as to how it works on your site, but not mine. I have reset all of the options to the default settings for search and yet I still hit a brick wall with titles.

Here's another example - take these two titles side-by-side in the forum:

1634740102097.webp

I search for 'Master of Reality' and I get this:

1634740148489.webp

Not even a statement about the following words being omitted because they were too short - the operative word in this search being 'of'

I search for 'Paranoid' and I get this:

1634740236818.webp

One word titles are not an issues unless they are less than 4 characters long, but why is the word 'of' in 'Master of Reality' saying no result when it should show the result but state the word 'of' was omitted from the search because it's too short? Something isn't right somewhere if it works on one forum but not another. I even thought some of my modifications may be getting in the way, so I reverted to the default theme and the issue was the same. Strange!
 
This should be MyISAM (this is how XenForo does create the table and it is the only supported configuration), if it is InnoDB that might explain what you are experiencing.

Bingo! It's InnoDB - so now that we know what that is, how can it be changed to MyISAM?

1634741363160.webp
 
Approach 1 (does take some time depending on the size)
Code:
ALTER TABLE xf_search_index Engine=MyISAM

Approach 2 (requires rebuilding the search index afterwards)
Code:
TRUNCATE xf_search_index;
ALTER TABLE xf_search_index Engine=MyISAM;

I'd got for Option 1 if the size isn't too big (as reindexing usually would take longer).
 
Top Bottom