joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[4.4] Smart Search: Properly sort filters

Open Hackwar opened this issue 1 year ago • 16 comments

Pull Request for Issue #41930.

Summary of Changes

The entries in the filters in Smart Search aren't properly ordered in the frontend.

Testing Instructions

  1. Create a website with some content, especially nested categories. Best solution would be to use the testing sampledata.
  2. Go to the Smart Search search view in the frontend and open the advanced filters
  3. Check for example the category filter

Actual result BEFORE applying this Pull Request

The categories are pretty much random.

Expected result AFTER applying this Pull Request

The categories are displayed properly like in the tree structure.

Link to documentations

Please select:

  • [ ] Documentation link for docs.joomla.org:

  • [X] No documentation changes for docs.joomla.org needed

  • [ ] Pull Request link for manual.joomla.org:

  • [X] No documentation changes for manual.joomla.org needed

Hackwar avatar Feb 19 '24 14:02 Hackwar

I have tested this item :white_check_mark: successfully on 55139c2bdc53459ab63c95d00c6559b20ec181a5


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

ceford avatar Feb 20 '24 12:02 ceford

@Hackwar Shouldn’t this be fixed in the 4.4-dev branch? The issue was reported for 4.3.

richard67 avatar Feb 20 '24 13:02 richard67

@richard67 See the last discussion we had about this. Nothing has changed since then.

Hackwar avatar Feb 20 '24 14:02 Hackwar

@richard67 See the last discussion we had about this. Nothing has changed since then.

@Hackwar So you think you as the JBS Team Lead and a member of the CMS Maintenance Team can do as you like and ignore all our policies?

richard67 avatar Feb 20 '24 14:02 richard67

I'm not ignoring policies. However I refuse to waste my time arguing if something is a bug and worthy of fixing in Joomla 4.4 and rather take the shortcut of providing that fix to 5.0+. Since the relevant maintainer decided to ignore this for over a week now as well, I'm assuming that it is fine the way I'm doing it.

Hackwar avatar Feb 20 '24 14:02 Hackwar

I have tested this item :white_check_mark: successfully on 55139c2bdc53459ab63c95d00c6559b20ec181a5


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

fgsw avatar Feb 21 '24 07:02 fgsw

RTC as it has 2 successful tests. Release managers pls. decide if it should go into 5.0-dev or 4.4-dev.


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

richard67 avatar Feb 21 '24 07:02 richard67

I've tested this on J5.1. I created some categories and subcategories in content and in contacts. I deliberately named some of the categories in contact and content categories the same. At first it seemed to work. The sort order in the pull down menu is now correct. Is it intended that the duplicate category names from the two different components are the shown as one?

After some testing the search didn't work for content anymore. Even if I turn of all other search plugins, and leave content the only one turned on. I did rebuild the smart search index. The advanced search does show the content categories, but whatever search word I enter, there's no result. If I turn on search for contacts, the contacts will be found, but no articles will show up.

I revoked the patch, and still the content search doesn't work anymore.


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

stimpsonjcat avatar Feb 24 '24 11:02 stimpsonjcat

Back to pending after rebase.


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

richard67 avatar Feb 24 '24 11:02 richard67

With J 5.1, the display after patching does not change. I made a category and subcategory

##ACCESSIBILITY IDEA I searched for the subcategory with its own prefix and found nothing, so I infer that the query does a search with the = operator. You can vary the search query with a LIKE '%''++'%'?

adj9 avatar Feb 24 '24 12:02 adj9

@stimpsonjcat Your issues are unrelated to this PR. This PR only touches the order of the entries in the filters.

@adj9 That is already an option in the component configuration of Smart Search. Also,if you only have 2 categories, there is nothing which could change, since they aren't out of order at that moment.

Hackwar avatar Feb 24 '24 13:02 Hackwar

I did test it again. It seemed that my articles had disappeared on the pizza-bugs-and-fun server. I did test it again in 5.1 alpha 3 and retested on the testserver of today. It works as expected. ✅

The only feature request I would suggest: if you have a top level category (i.e. red) and and a sublevel category (i.e. light red), I would expect, as an enduser, if I search in the top-level I would also find results in the sublevel.

stimpsonjcat avatar Feb 24 '24 14:02 stimpsonjcat

I did test it again. It seemed that my articles had disappeared on the pizza-bugs-and-fun server. I did test it again in 5.1 alpha 3 and retested on the testserver of today. It works as expected. ✅

@stimpsonjcat Could you use the blue "Test this" button in the issue tracker https://issues.joomla.org/tracker/joomla-cms/42835 to submit your test result? Otherwise it is not counted. Thanks in advance.

richard67 avatar Feb 24 '24 14:02 richard67

I have tested this item :white_check_mark: successfully on 4a8e9a123474185f314b56b7cecb2c69b323bb9c

Created multiple categories and subcategories in content and in contacts. Added some articles and contacts. Some contacts have the same word in the name as in the article. (I've written an article on Stefanie and added a contact named Stefanie) In the frontend searched on Stefanie and clicked on the advanced search. The category dropdown now shows the categories in the correct alphabetical order and hierarchy. The categories with the same names in content and contacts are shown as one category.


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

stimpsonjcat avatar Feb 24 '24 14:02 stimpsonjcat

I have tested this item :white_check_mark: successfully on 4a8e9a123474185f314b56b7cecb2c69b323bb9c


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

eddiekonczal avatar Feb 24 '24 14:02 eddiekonczal

RTC


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

Quy avatar Feb 24 '24 14:02 Quy

Just to be safe: can we have another test here?

MacJoom avatar Mar 04 '24 15:03 MacJoom

Back to pending


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

laoneo avatar Mar 04 '24 15:03 laoneo

No good! With the patch applied I see the list in order but part of the Sample Data Articles is repeated.


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

ceford avatar Mar 04 '24 16:03 ceford

Why do you want another test for this?

Hackwar avatar Mar 04 '24 16:03 Hackwar

@ceford can you please be a bit more specific? What do you see repeated where?

Hackwar avatar Mar 04 '24 16:03 Hackwar

image

ceford avatar Mar 04 '24 17:03 ceford

I'm getting errors in Joomla 5.1.0-alpha4:

Warning: Undefined property: stdClass::$id in /administrator/components/com_finder/src/Indexer/Result.php on line 576

Warning: Attempt to read property "state" on array in /administrator/components/com_finder/src/Indexer/Result.php on line 577

Warning: Attempt to read property "access" on array in /administrator/components/com_finder/src/Indexer/Result.php on line 578

stimpsonjcat avatar Mar 04 '24 17:03 stimpsonjcat

I'm getting errors in Joomla 5.1.0-alpha4:

@stimpsonjcat How is this related to this PR here which is clearly made for 4.4-dev and not 5.1-dev?

richard67 avatar Mar 04 '24 18:03 richard67

I have tested this item :white_check_mark: successfully on ded674e9b2b143d65b6ee7c53f598220b46d8026

Oops - my previous comments were for J5. J4 Seems to work fine.


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

ceford avatar Mar 04 '24 18:03 ceford

As we added only a type to a function argument, one test is enough. So merging it as it was RTC before.

laoneo avatar Mar 05 '24 07:03 laoneo

Thanks!

laoneo avatar Mar 05 '24 07:03 laoneo