Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0] HTML Error 414 on Smart Search #42889

Closed
dautrich opened this issue Feb 26, 2024 · 12 comments
Closed

[5.0] HTML Error 414 on Smart Search #42889

dautrich opened this issue Feb 26, 2024 · 12 comments

Comments

@dautrich
Copy link

dautrich commented Feb 26, 2024

Steps to reproduce the issue

  1. Go to URL https://www.systemtest.neudorf-mkk.de/
  2. Click on "Suchen" in the top horizontal navigation
  3. Enter "joomla 4" in the search field and click button "Suchen"
  4. Click on any of the results

Expected result

The respective page of the website is displayed.

Actual result

  1. An extremely long URL is created (s. the browser's status bar):

grafik

  1. You get an HTML error 414 ("Request-URI too lond")

grafik

System information (as much as possible)

Joomla 5.0.3
PHP 8.2.2
MySQL 8.0.33

Additional comments

  1. When searching for "joomla" or "joomla version" or "joomla 51", everything works fine. So the issue seems to be related to the digit (or string?) 4 in the search field.
  2. The testsite is not really small, but contains more than 1.200 articles with several access levels.
  3. I've not been able to reproduce the issue on a small test site (https://www.current.rolfdautrich.de, search for "joomla 5").
@brianteeman
Copy link
Contributor

the long string in the url is a base64 decoded string of the terms to highlight on the page.

@dautrich
Copy link
Author

@brianteeman
Do you have an idea why "joomla 4" produces such a long string, while "joomla 51" makes a relatively short one?

@Fedik
Copy link
Member

Fedik commented Feb 29, 2024

Change Smart Serach configuration. Change "Word Match" to "Match exactly".

@Fedik
Copy link
Member

Fedik commented Feb 29, 2024

It happens because you have set "Word Match" to "Match words containing the search term anywhere".
And this produce huge result while searching for 4

} elseif ($this->wordmode === 'fuzzy') {
$searchTerm = '%' . $searchTerm . '%';
$searchStem = '%' . $searchStem . '%';
$query->where('(' . $term . ' LIKE :searchTerm OR ' . $stem . ' LIKE :searchStem)');
} else {

@Fedik Fedik added the bug label Feb 29, 2024
@Fedik
Copy link
Member

Fedik commented Feb 29, 2024

I set it as a bug, we at least should limit the number of terms to highlighting.
Similar to what Hannes already made for JS #41463

@Fedik
Copy link
Member

Fedik commented Feb 29, 2024

Please test #42921

@Fedik Fedik closed this as completed Feb 29, 2024
@dautrich
Copy link
Author

The issue was filed for J5.0, but the resulting PR #42921 is for J4.4, as of the headline. Does it apply to J5.0 as well?

@Fedik
Copy link
Member

Fedik commented Feb 29, 2024

The bug affects both 4.x and 5.x,
After fixing 4.x it will be upmerged to 5.x

@dautrich
Copy link
Author

dautrich commented Feb 29, 2024

@Fedik

Under J4.4, the behaviour is different from what I've seen in J5.0:

Without or with the patch applied:

  • I see a JS error in devtools

grafik

  • I get a result list and can select the found article, which opens correctly. No sign of extra-long URIs.

Under 5.0, I get the error described above.

@Fedik
Copy link
Member

Fedik commented Feb 29, 2024

I think you have a different configuration for Smart search for j4 and j5.

The error will not happen on default installation, with default parameters.
Only when you change them. Check my previous comments (#42889 (comment)), or the description in the linked PR.

@dautrich
Copy link
Author

I have set the Smart Search configuration as described in your testing instructions. And "Word Match" is set to exactly this option on my faulty site.

@Fedik
Copy link
Member

Fedik commented Feb 29, 2024

Another reason that your test installation for j4 has less amount of content than my.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants