Page 1 of 1

Phoca Gallery Category Finder Plugin (Categories): limit the search to a max level

Posted: 03 Sep 2026, 11:34
by marcoaiki
Hi,
The current category search plugin does not limit the indexing /search and therefore all the subcategories are indexed for search.
In my case, the subcategories are meaningless and it would be interesting to limit the smart search to the a maximum level and not to all of them.

Is it something other people are interested in and therefore a possible new feature of the plugin?

Re: Phoca Gallery Category Finder Plugin (Categories): limit the search to a max level

Posted: 03 Sep 2026, 16:14
by Jan
Hi, the smart search feature is a Joomla feature, for now no idea, if it is possible to do such change :idea:

Jan

Re: Phoca Gallery Category Finder Plugin (Categories): limit the search to a max level

Posted: 04 Sep 2026, 13:40
by marcoaiki
Maybe I'm wrong,
but the "Phoca Gallery Finder Plugin (Categories) (J6)" is a classic adapter for joomla smart search (finder).
In the method getListQuery() you can add a where condition to limit the indexing to the main levels,e.g.:

for only the main level

Code: Select all

$query->select($case_when_category_alias)

			->from('#__phocagallery_categories AS a')
			->join('LEFT', '#__phocagallery_categories AS c ON c.id = a.parent_id')
			->where('a.parent_id = 0'); // <--- for categories without parent category
			//->where('a.approved = 1');
		return $query;

if you want to maintain only the first and second level, the where condition will be:

Code: Select all

->where('(a.parent_id = 0 OR c.parent_id = 0)');
well ... considering more than two level entails also to a more complicated sql

and of course there is also the problem of adding a setup option in the admin plugin page ....