Support > Elxis 4.x/5.x DEV

second search engine?

(1/4) > >>

seadhna:
Hi there,
is it possible to have a second search engine that is set to search only one category?
A user can select which category to search manually but in a particular category I would like to have a search engine that is already pre-set to search only that category. If I copy the search module and have the copy appear on only the category in question, this works - but it still searches the entire site by default. I have played around with Mikro and Mikro search to see if this would work but it does not address this need unfortunately. Grateful for any suggestions!

datahell:
Search engines are extensions like modules. You can develop your own engine or modify an existing one to work as you want. If you want to search only within a specific category hide the categories drop down list and insert a hidden field with the value of the category you want only to search into.

seadhna:
Of course! Works like a charm - thanks!

seadhna:
Hi datahell,
is there a way to exclude just one category from search? But include ALL other categories?

datahell:
The easiest way to make the default content search engine to exclude a specific category from search is to exclude that category from category selection drop down box. To do so do the following:

Open file components/com_search/engines/content/content.engine.php
Go to line 184:
foreach ($categories as $category) {
Add below:
if ($category['catid'] == 999) { continue; }
Change 999 with the id of the category you want to exclude from selection box.

Navigation

[0] Message Index

[#] Next page

Go to full version