e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
318 stars 212 forks source link

[Bug]: The search menu and page doesn't found any content on the page #5209

Open sanslash332 opened 3 months ago

sanslash332 commented 3 months ago

What e107 version are you using?

Latest Github version (just updated)

Bug description

Hello guys. With a few friends we have a production Ready site using e107 since 2015, and recently we've updated from 2.2 to the latest git 2.4.0, and upgraded from php 5.6.40 to 7.4.33, because well... the hosting is deprecating all php below version 7, so we had to update. ANd for future we are planing to upgrade to php8.

We lost some small plugins and other small things during the update process that aren't important, but we found that the search feature isn't working on the new version. We tried using the search menus and page, but the query didn't found anithing. The site have a lot of content on downloads, forums, news, but the search can't find anythin. This is the page https://www.tiflojuegos.com Is in spanish.

Is something wrong with that plugin? We forget configure something? All other things works veri fine.

A, is a site for blind people, so... dont take care about the theme; we are using the default bootstrap5. Because our old theme (defianstrap) aren't compatible with php8.

How to reproduce

  1. open the tiflojuegos website at www.tiflojuegos.com
  2. write something on the searchbox. Example manamon, windows, mud, doom, etc.
  3. press enter
  4. See how the search results are empty
  5. try to find other thing. same result.
  6. check page content to verify that the site isn't empty.

Expected behavior

That the search feature works. Finding the exact results or similar according with the search.

What browser(s) are you seeing the problem on?

Firefox, Chrome / Brave, Microsoft Edge

PHP Version

7.4.33

Jimmi08 commented 3 months ago

@sanslash332 try to go to Preferences, Search, and resave settings.

sanslash332 commented 3 months ago

thanks @Jimmi08 for the tip. I've did that, but no luck.

I go to the settings / search menu and save preferences, inclusive edited some of the searchable areas changing things like results displayed per page and other things to force a setting change, but same behavior. Any thing that you search got nothing as a result.

Maybe a method to check which mysql query is using the system?

Or some other thing that can be bad configured?

Thanks

Jimmi08 commented 3 months ago

I can't help more, I had a similar issue, I debugged and I found that relevance is not working for me.
https://github.com/e107inc/e107/discussions/5198

Alex-e107nl commented 3 months ago

I can confirm that with the latest GitHub the search function no longer works, English or Dutch makes no difference, PHP Version 8.1.27, e107 Version 2.4.0 (git), MySQL 10.5.24-MariaDB you can test it on https://e107.nl/search screen_search_2024-03-12 101230

Settings admin: screen_search_2024-03-12 101230

Jimmi08 commented 3 months ago

thanks @Jimmi08 for the tip. I've did that, but no luck.

Maybe a method to check which mysql query is using the system?

Thanks

Go to preferences, Advanced and set developer mode ON. Then select SQL Analysis image

You should get something like this: image

Copy the query and put it directly to phpmyadmin.

In my case it should found something in pages

SELECT SQL_CALC_FOUND_ROWS p.page_id, p.page_title, p.page_sef, p.page_text, p.page_chapter, p.page_datestamp, p.menu_image, ((1.2 * (MATCH(p.page_title) AGAINST ('lorem' IN BOOLEAN MODE))) + (0.6 * (MATCH(p.page_text) AGAINST ('lorem' IN BOOLEAN MODE))) + (1.0 * (MATCH(p.page_metakeys) AGAINST ('lorem' IN BOOLEAN MODE))) + (0.5 * (MATCH(p.page_fields) AGAINST ('lorem' IN BOOLEAN MODE)))) AS relevance FROM e107_page AS p LEFT JOIN e107_page_chapters AS c ON p.page_chapter = c.chapter_id WHERE (c.chapter_visibility IN (253,247,254,250,251,0) OR p.page_chapter = 0) AND p.page_class IN (253,247,254,250,251,0) AND p.page_text != '' AND (MATCH(p.page_title) AGAINST ('lorem' IN BOOLEAN MODE) || MATCH(p.page_text) AGAINST ('lorem' IN BOOLEAN MODE) || MATCH(p.page_metakeys) AGAINST ('lorem' IN BOOLEAN MODE) || MATCH(p.page_fields) AGAINST ('lorem' IN BOOLEAN MODE)) HAVING relevance > 0 ORDER BY relevance DESC , page_datestamp DESC LIMIT 0,10;

getting error: Can't find FULLTEXT index matching the column list

Tested in 2.3.3 database - it works, tested in latest github - it doesn't.

Deltik commented 3 months ago

Okay… this is a moderate challenge to fix…

Indeed, the search bug was caused by the migration from MyISAM to InnoDB in https://github.com/e107inc/e107/issues/4501.

We somehow need to CREATE FULLTEXT INDEX for every field specified in the search_fields key returned by overrides of e_search::config() (in the e_search addons). Perhaps this is something that can be implicitly derived in /e107_admin/db.php.

sanslash332 commented 3 months ago

Just for have more evidence, but its the same bugs that various of you show before:

here the query that I've got through the debug system of the page, when search the word "manamon" over the download section. On the site exists a page with exact that name, so the system must found it.

SELECT SQL_CALC_FOUND_ROWS d.download_id, d.download_sef, d.download_category, d.download_name, d.download_description, d.download_author, d.download_author_website,
d.download_datestamp, d.download_class, c.download_category_id, c.download_category_name, c.download_category_sef, c.download_category_class, ((1.2 * (MATCH(d.download_name)
AGAINST ('manamon' IN BOOLEAN MODE))) + (0.9 * (MATCH(d.download_url) AGAINST ('manamon' IN BOOLEAN MODE))) + (0.6 * (MATCH(d.download_description) AGAINST
('manamon' IN BOOLEAN MODE))) + (0.6 * (MATCH(d.download_author) AGAINST ('manamon' IN BOOLEAN MODE))) + (0.4 * (MATCH(d.download_author_website) AGAINST
('manamon' IN BOOLEAN MODE)))) AS relevance FROM e107_download AS d LEFT JOIN e107_download_category AS c ON d.download_category = c.download_category_id
WHERE download_active > '0' AND d.download_visible IN (3,0,1,2,253,254,250,251) AND c.download_category_class IN (3,0,1,2,253,254,250,251) AND (MATCH(d.download_name)
AGAINST ('manamon' IN BOOLEAN MODE) || MATCH(d.download_url) AGAINST ('manamon' IN BOOLEAN MODE) || MATCH(d.download_description) AGAINST ('manamon' IN
BOOLEAN MODE) || MATCH(d.download_author) AGAINST ('manamon' IN BOOLEAN MODE) || MATCH(d.download_author_website) AGAINST ('manamon' IN BOOLEAN MODE))
HAVING relevance > 0 ORDER BY relevance DESC , download_datestamp DESC LIMIT 0,10;

The system found 0 results, and this error appear on the page:

SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list

Same errors got on phpmyadmin.

1191 - No puedo encontrar índice FULLTEXT correspondiendo a la lista de columnas

translated to english is the same of abobe.

Well, thanks for all guys; wait to the fix :-)

sanslash332 commented 3 months ago

For anybody that can't wait to the fix be solved on the code,

You can follow the instructions of @Deltik on this comment. https://github.com/e107inc/e107/issues/4501#issuecomment-1996879867

It solved the problem for me without changing the database structure. ¡thanks!