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

Phoca Gallery - image gallery extension
marcoaiki
Phoca Member
Phoca Member
Posts: 17
Joined: 24 Nov 2009, 10:24

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

Post 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?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49569
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post 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
If you find Phoca extensions useful, please support the project
marcoaiki
Phoca Member
Phoca Member
Posts: 17
Joined: 24 Nov 2009, 10:24

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

Post 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 ....
Post Reply