📜 ⬆️ ⬇️

Google Search Integration into Drupal website

image Some time ago it became necessary to organize a search on a site on the Drupal with filtering by type of materials and the ability to search by user profiles. The existing solutions did not suit for several reasons. Two options immediately came to mind: either write your search (using ready-made libraries like phpMorphy), or use Google. We stopped at the second.

The logic of work is simple: Google allows you to search on a specific site. That is, we can search on www.example.com , on www.example.com/first , on www.example.com/second , etc. To search for certain types of materials, we only need to configure different paths for different types of materials and embed them on the Google Custom Search site.

Then, briefly, step by step, how it works (a lot of code, no pictures):


')
Download the result here or here.

Criticism is welcome.

Source: https://habr.com/ru/post/79860/


All Articles