How to hide a catalog item from search but not the catalog itself?

shoobadoop
Tera Contributor

Hello everyone,

On our Portal we have a catalog called Links which houses a ton of content items that lead to various things (applications, department homepages, etc.). We have created a category called *Essential* which contains duplicate content items that our end users are most likely to be interested in. However, since these content items are duplicates, these duplicates also show up in the search bar.

We thought that toggling "No search" would bar the Essential links from the search bar yet keep them in the Catalog, but it looks like it removes them from both (though strangely the item count still appears next to the category name). Does anyone have any ideas on how we can fix this?

Thank you!

find_real_file.png

1 ACCEPTED SOLUTION

Hi, 

 

You can update the scriptt as mentioned below, just add the sys_id of the category you want to omit from seaching.

 

sc = new sn_sc.CatalogSearch().search(portalValue, '', query);
sc.addQuery('sys_class_name', 'NOT IN', 'sc_cat_item_wizard');

// Replace sys_id with the category sys_id that should not be included in search
sc.addEncodedQuery('hide_sp=false^ORhide_spISEMPTY^category!=sys_id');

View solution in original post

7 REPLIES 7

bammar
Kilo Sage
Kilo Sage

Why not deactivate all duplicates? You can place an item in multiple catalogs and within each put the best fitting category - this will yeild 1 result

Unfortunately, we can't take this route because all of the links are within a single catalog called Links. We would like our "ServiceNow" link to be under the Essential category, but we would also like it to be under Applications as well - hence the need for the duplicates. We just don't want "ServiceNow" to come up twice in the search bar.

Sagar Agarwal
Mega Guru

Hi @shoobadoop 

 

You can go to portal record and configure the search source for the catalog to exclude the required category while performing the search.

We thought that might be the solution, but unfortunately we're pretty bad at writing JavaScript code  XD

We think that these may be the lines to edit though. Do you have any suggestions on how we could modify this?

 

sc = new sn_sc.CatalogSearch().search(portalValue, '', query);
sc.addQuery('sys_class_name', 'NOT IN', 'sc_cat_item_wizard');
sc.addEncodedQuery('hide_sp=false^ORhide_spISEMPTY');