📑 How to Integrate Google Programmable Search Engine with Xenforo 2.2.x

Roiarthur

Active member
🚀 Introduction

This tutorial guides you through the steps to integrate Google's "Programmable Search Engine" into a Xenforo 2.2.x installation, enhancing the search functionality on your forum.

Note: Tutoriaux-Excalibur uses Google search in Xenforo search engine and it works great.



🏷️ Prerequisites

• You must have a Google account to access the Programmable Search Engine service.

• Have a Xenforo 2.2.x forum installed and operational.



📝 Procedure

Creating Your Custom Search Engine

• Go to Programmable Search Engine and log in with your Google account.

• Click on the "Create a search engine" button and enter the details of your site. Use the base URL of your forum.

• Configure the language settings and visual aspects of your search engine.

• Once created, Google will provide you with a unique "Engine ID". Note this ID as it will be needed later.



⚙️ Integration into Xenforo

• Log in to your Xenforo admin panel.

• Navigate to "Appearance" then "Templates".

• Search for and edit the template called "search_form".

• Replace the existing search form with the following HTML code, replacing "YOUR_ENGINE_ID" with your actual engine ID:
Code:
<form action="https://cse.google.com/cse?cx=YOUR_ENGINE_ID" method="get">
  <input type="text" name="q" size="31">
  <input type="submit" name="sa" value="Search">
</form>
• Save your changes.



⚠️ Warning

Ensure that you have replaced "YOUR_ENGINE_ID" with the engine ID provided by Google. An error here will prevent the search from functioning correctly.



💡Tip

Test your search engine to ensure it returns the expected results. Adjust the customization settings in your Google configuration panel if necessary.



🔗 References

Support Microsoft Search

Learn Microsoft Search

Google Search



🏁 Conclusion

By following these steps, you will have successfully integrated Google's Programmable Search Engine into your Xenforo forum, thereby enhancing the search experience for your users.
 
Last edited:
I do not want to install elastic Search Andy using Google to Search on n'y own forum was the best alternative
 
Back
Top Bottom