Google Custom Search Engine allows you to create a custom search engine for your knowledge base powered by Google. It's free, but you are required to show ads unless you are a non-profit or a school. If that's not a dealbreaker for you, you can also monetize your knowledge base using Adsense.
Implementing Google CSE in KnowledgeOwl
To integrate Google CSE in to your KnowledgeOwl knowledge base, you'll need two things:
- A page to hold your CSE code
- A search form to send your users to the search page
Creating a page to hold the search results
We recommend using a default category for your custom search. This will provide a nice blank canvas for the search input and results to be displayed. You can check the option to hide the category from navigation so it doesn't show up in your navigation.
Now's a good time to pause (and save), and check out your new search page! Click View Category at the top of the screen to see your custom search page in action.
Adding search forms to your homepage or articles
Allowing your users easy access to this search page is the next important piece of the puzzle. At its simplest, this could be set up with an ordinary hyperlink to the category page ("Click here for our search page").
You can go a step further by using an HTML form instead of a hyperlink. This will allow you to add a textbox, and pass the user's search terms as a query string to your search page. Google CSE automatically picks up queries embedded in the URL, so seamlessly integrating this new search capability anywhere in your knowledge base becomes a snap!
Below is an example of how this search form might look.
<form action="/help/search-results/" method="get"> <input name="q" type="text"> <button type="submit">Search</button> </form>
Three important things to note:
- The form action points to the URL of the search "category page".
- The form method is "get".
- The text input name is "q".
The text input name you can actually change to whatever you'd like, be sure to make the necessary adjustments to your Google CSE code, so it knows to look for the query string by that variable name.
By including a form like the one above on your homepage or in your top navigation, your users will now have easy access to your Custom Search Engine!