? ? Failure

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
31 Jul 2018

Smart Search has a rather good taxonomy that allows to add a lot of additional filters for the search. However there are 2 flaws:

  • Nested taxonomies (like categories) are squashed into a flat list and
  • The state of a taxonomy is not updated in the search result.

This PR tries to fix both these flaws.

How does it work?

For legacy finder plugins, everything stays as it was, so we should be pretty much backwards compatible here. However new (or updated) plugins can use the new FinderIndexerResult::addNestedTaxonomy() method to add nested taxonomies. This method gets a node object as a parameter, which has to implement at least the ImmutableNodeInterface interface, that is introduced with this PR. Internally it iterates down the tree along its parents, adds each parent as a taxonomy node with the previous node as its parent. In the result object, we are now also storing the taxonomy ID so that we can lookup the right taxonomy again later. The taxonomy table has been changed to a nested set table.

How to test?

Apply these changes and make sure that the DB changes are applied, too. Then clear the index and re-run the indexing. You can then see the category filter in the frontend having a nested display, as well as in the backend. Check the taxonomy table in the DB for the nested entries, too.
Check if it properly filters for the respective taxonomies in the frontend when searching.
Enable displaying the taxonomies in the frontend and check that you can disable branches and single taxonomies and that those properly vanish from the filters and the result display. Create Search Filters in the backend and test those, too, if they properly honour the taxonomies.

Status of this PR

This PR is mostly working, but I'm not 100% confident that I caught all changes that are necessary. I think I'm now depending a bit on feedback from you.

6b416a6 16 Jun 2018 avatar Hackwar Typo
avatar Hackwar Hackwar - open - 31 Jul 2018
avatar Hackwar Hackwar - change - 31 Jul 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Jul 2018
Category SQL Administration com_admin Postgresql com_finder Front End Installation Libraries Plugins
avatar Hackwar Hackwar - change - 31 Jul 2018
Labels Added: ?
avatar Hackwar Hackwar - change - 31 Jul 2018
The description was changed
avatar Hackwar Hackwar - edited - 31 Jul 2018
avatar Hackwar Hackwar - change - 2 Aug 2018
Title
[4.0] Smart Search: Adding nested taxonomy (POC)
[4.0] Smart Search: Adding nested taxonomy (WIP)
avatar Hackwar Hackwar - edited - 2 Aug 2018
avatar Hackwar Hackwar - change - 2 Aug 2018
The description was changed
avatar Hackwar Hackwar - edited - 2 Aug 2018
avatar Hackwar Hackwar - change - 2 Aug 2018
The description was changed
avatar Hackwar Hackwar - edited - 2 Aug 2018
avatar Hackwar Hackwar - change - 2 Aug 2018
The description was changed
avatar Hackwar Hackwar - edited - 2 Aug 2018
avatar Hackwar Hackwar - change - 2 Aug 2018
Title
[4.0] Smart Search: Adding nested taxonomy (WIP)
[4.0] Smart Search: Adding nested taxonomy
avatar Hackwar Hackwar - edited - 2 Aug 2018
avatar Hackwar
Hackwar - comment - 9 Jan 2019

Right now this depends on #23452 being merged first.

avatar HLeithner
HLeithner - comment - 17 Feb 2019

On index or saving a article I get a fatal error:

Fatal error: Cannot use Joomla\CMS\Tree\NodeInterface as NodeInterface because the name is already in use in libraries/src/Categories/CategoryNode.php on line 18
avatar joomla-cms-bot joomla-cms-bot - change - 19 Feb 2019
Category SQL Administration com_admin Postgresql com_finder Front End Installation Libraries Plugins SQL Administration com_admin Postgresql com_finder Language & Strings Front End Installation Plugins
avatar Hackwar Hackwar - change - 20 Feb 2019
Labels Added: ?
avatar Hackwar
Hackwar - comment - 20 Feb 2019

I've made all requested changes. Should be good to go. I can't see that the failing system test is related to this.

avatar wilsonge wilsonge - change - 28 Feb 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-02-28 12:30:08
Closed_By wilsonge
avatar wilsonge wilsonge - close - 28 Feb 2019
avatar wilsonge wilsonge - merge - 28 Feb 2019
avatar wilsonge
wilsonge - comment - 28 Feb 2019

Looks like an improvement to me! Thanks!

avatar Hackwar
Hackwar - comment - 28 Feb 2019

💃 🍾 Thank you!

Add a Comment

Login with GitHub to post a comment