Drupal search without reindex

In Drupal, if you want to let your published node appear in search results, you need to re-index the search first (Administration->Configuration->Search Settings). And the Drupal cron job file (cron.php) will be executed to re-index the site at a specific time on every minute, every hour or every day, etc.

But recently I’m building a project outsourcing site, I need the newly posted project can be searched by other users immediately after it’s published. I searched on Google and Drupal for a while, finally I found this module: Auto-Index.

This module will automatically re-index the nodes every time a new node is created or an existing node is edited. And there is no more configuration needed after installing.

Drupal Get User ID

In Drupal the logged in user is stored as a global variable. Following code can access the logged in user ID

And in profile page, you can use $user variable directly