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

[4.4] Smart Search: Limiting highlighting of tokens #41463

Merged
merged 10 commits into from
Sep 15, 2023

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Aug 26, 2023

Pull Request for Issue #28239.

Summary of Changes

Depending on the language and smart search settings, smart search might find a lot of compound words and tokens for a small search entry. These tokens then are all converted into code for the highlighting script, which is then added to the URL of each search result. In worst case, this can make the URL to long to be processed by the webserver. This PR limits the maximum amount of tokens to 10, so that doesn't get out of hand. Yes, this does mean, that some terms, which would be part of the search result, don't get highlighted, but I'd rather have some terms not highlighted than the page breaking completely.

Testing Instructions

Search for something with more than 10 different words, for example in the test sampledata "Thanks for helping us to test Joomla! We're getting ready for the release of Joomla and we appreciate you helping us". Look at the sourcecode of the page and look for the block containing "class": "js-highlight",. Below you will find a list of all search terms it is highlighting.

Actual result BEFORE applying this Pull Request

The list contains more than 10 words, in the case of the above search phrase it is 23.

Expected result AFTER applying this Pull Request

The list is limited to 10 words.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Co-authored-by: Quy <quy@nomonkeybiz.com>
@richard67 richard67 added the bug label Aug 26, 2023
@KingLouis1
Copy link

I have tested this item ✅ successfully on 191e612


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41463.

1 similar comment
@Quy
Copy link
Contributor

Quy commented Sep 3, 2023

I have tested this item ✅ successfully on 191e612


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41463.

@Quy Quy removed the bug label Sep 3, 2023
@Quy
Copy link
Contributor

Quy commented Sep 3, 2023

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41463.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 3, 2023
@Quy Quy added the bug label Sep 3, 2023
@Quy
Copy link
Contributor

Quy commented Sep 3, 2023

Under Highlight Search Terms setting, should there be an inline help stating that up to 10 search terms will be highlighted?

@obuisard obuisard changed the base branch from 4.3-dev to 4.4-dev September 11, 2023 13:44
@obuisard obuisard changed the title [4.3] Smart Search: Limiting highlighting of tokens [4.4] Smart Search: Limiting highlighting of tokens Sep 11, 2023
@laoneo
Copy link
Member

laoneo commented Sep 11, 2023

@Hackwar can you update the language string mentioned by @Quy? Then I would this one is ready for the next beta.

@joomla-cms-bot joomla-cms-bot added the Language Change This is for Translators label Sep 12, 2023
@Quy
Copy link
Contributor

Quy commented Sep 13, 2023

I have tested this item ✅ successfully on edfb611


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41463.

@MacJoom MacJoom self-assigned this Sep 13, 2023
@MacJoom MacJoom merged commit ec426c5 into joomla:4.4-dev Sep 15, 2023
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Sep 15, 2023
@Quy Quy added this to the Joomla! 4.4.0 milestone Sep 15, 2023
HLeithner added a commit that referenced this pull request Sep 19, 2023
* [4.4] Upmerge (#41733)

* [4.3] fix localised cli installation (#41706)

* [4.3] Work around a successful upgrade with silent errors (#41367)

* Log all

* Capture errors

* Log messages

* Error collector

* Error collector

* More error collecting

* More error collecting

* Show errors

* Cli command check errors

* phpcs

* phpcs

* Back button and better text

* phpcs

* logs

* Make sure logging is working before continue

* Apply suggestions from code review

---------

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Harald Leithner <leithner@itronic.at>

* cs

---------

Co-authored-by: heelc29 <66922325+heelc29@users.noreply.github.com>
Co-authored-by: Fedir Zinchuk <getthesite@gmail.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>

* [4.3] Fix untranslated constants in script.php (#41734)

* restrict choicesjs input on container (#41478)

* [4.4] Add Joomla 5 compat plugin to 4.4.0 to fix class "JPlugin" not found error on update to 5 (#41738)

* Add J5 compat plugin to 4.4.0

* Adapt provider.php to latest changes in 5.0-dev

* Add to ExtensionsHelper

* Use protected = 0

* Better XML description.

* Use correct creationDate in XML file

Co-authored-by: Brian Teeman <brian@teeman.net>

---------

Co-authored-by: Brian Teeman <brian@teeman.net>

* [4.4] Smart Search: Limiting highlighting of tokens (#41463)

* Smart Search: Limiting highlighting of tokens

* Update components/com_finder/tmpl/search/default_results.php

Co-authored-by: Quy <quy@nomonkeybiz.com>

* Adding inline help text

---------

Co-authored-by: Quy <quy@nomonkeybiz.com>
Co-authored-by: Olivier Buisard <olivier.buisard@simplifyyourweb.com>
Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>
Co-authored-by: Martin Carl Kopp <6154099+MacJoom@users.noreply.github.com>

* No longer a code owner

build.xml is part of the testing team stuff and the rest I’m removing myself from

* Fields is maintained by everybody now

* Invalid import from upmerge

* Set the configuration options through a command (#41787)

* Set the configuration options through a command

* cs

* PHP 8.2 Creation of dynamic property (#41554)

* Fix deprecated message in categories (#41587)

* [4.3] fix finder common words (#41468)

* [4.3] Fix missing filter for subject (#41726)

* Fixed database upmerge conflicts

* Update installation/sql/mysql/base.sql

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>

---------

Co-authored-by: heelc29 <66922325+heelc29@users.noreply.github.com>
Co-authored-by: Fedir Zinchuk <getthesite@gmail.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Magnus Singer <work@magnus-singer.com>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Hannes Papenberg <info@joomlager.de>
Co-authored-by: Quy <quy@nomonkeybiz.com>
Co-authored-by: Olivier Buisard <olivier.buisard@simplifyyourweb.com>
Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>
Co-authored-by: Martin Carl Kopp <6154099+MacJoom@users.noreply.github.com>
Co-authored-by: George Wilson <georgejameswilson@googlemail.com>
Co-authored-by: Denitz <197527+Denitz@users.noreply.github.com>
Co-authored-by: Christiane Maier-Stadtherr <dev@chmst.de>
Kostelano added a commit to JPathRu/localisation that referenced this pull request Oct 19, 2023
@Hackwar Hackwar deleted the 4.3-finder-highlighter branch March 22, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants