cancel
Showing results for 
Search instead for 
Did you mean: 
greg_lawrence
Community Participant

Catalog's Search Form - how does it work?

I am trying to find some documentation on how Catalog's search form works but can't find much online. From using it in our instance, it appears it works by searching for Listings in the immediate Catalog not the sub-catalogs beneath it. Is that how it works?

If that is the case, then it's not that useful when a lot of your main catalog pages contain no course listings. Just wondering if any other Catalog users have encountered this issue and how have you managed it? 

Was thinking about:

  • Adding some code to make the search engine results show on a separate browser window than on our main catalog page - which is set up not to show any listings; and
  • Setting up another search engine that searches the whole Catalog.

Keen to hear your thoughts on this.

Cheers

Greg 

Tags (2)
11 Replies
jsowalsk
Community Advocate
Community Advocate

The search bar works from the tags that you put into the listing such as metadata about the course.

greg_lawrence
Community Participant

Hi Jessica.

The search form works for tags and other text strings you type in but the results returned come from the listings associated with (mapped to) the catalog page where the search was done. 

For example, most of our courses are for teachers and all of our catalog listings contain the text 'teach'. Typing this into the search form only returns one listing located in the route catalog (the catalog homepage). It does not show all the other listings. See below.

319452_teach.png

Is that meant to happen? Otherwise, I need to come up with another way for visitors to do deep searches in Catalog to find the courses they want. 

Hope that makes sense.

Greg 

Yes, it is since the other courses/listings are either hidden or by a link. 

greg_lawrence
Community Participant

Hi Jessica 

Thanks for your feedback.

After a bit of thinking, I got around the problem by setting up the main Catalog page inherit listings categories in all of the other catalogs and hiding them with some jquery.  

By doing this, the search engine on the catalog homepage searches all the catalogs.

Cheers

Greg 

Awesome. Could you send me the instructions and code on how you did this?

greg_lawrence
Community Participant

No worries Jessica

What I did:

On the main catalog (home) page I inherited categories from the sub-catalogs ancestry and created categories for all the sub-catalogs. Doing both those things in Catalog  (not sure if the order really matters) made all Catalog course listings display on our Catalog homepage.

As we have our own Catalog tiles on the homepage, we do not want to display any listing there. But we do want the Catalog homepage search engine (form) to be able to search all of our course listings and for the results to be displayed on a separate page that is not the Catalog homepage.

Do do this, I used the jquery hide function to hide course listings.

$('#listings').hide();

 

I then created an additional click event that is triggered at the same time someone submits a new search query that reloads the browser's window. The timing of this click event has a slight delay on it so the search query results are returned first before the page reloads. Doing this allows for the search query results to load onto a new webpage. 

$( "#search-submit" ).click(function() {
setTimeout("location.reload();", 1000);
});

Hope this makes sense and I suspect I am not the first to work this out. 

Cheers

Greg 

jsowalsk
Community Advocate
Community Advocate

Can you please share your catalog so I can see how this functions?

greg_lawrence
Community Participant

No worries.

Here is our beta catalog environment: ISV's Catalog 

Just type in 'test' or 'course' into the search bar to generate a search result.

Cheers

Greg  

jsowalsk
Community Advocate
Community Advocate

Very cool!!! Thanks.