Hi,
Please don't post duplicate questions.
Rebuildiung the search index is not something that needs to be done frequently. It only needs to be done if there is some problem in the search index that would be corrected by rebuilding it.
To implement search in your custom features you should read the article Making Custom Features Searchable, and you should study the source code for existing features that support search to further understand how it works and how to do it.
Basically you implement an IndexBuilder for your feature and you wire up a ContentChangedEventHandler in your feature edit page that invokes your custom index builder when your custom content is edited. Then finally you call:
SiteUtils.QueueIndexing();
after saving your content.
Your index builder serializes index items into the mp_IndexingQueue table, and the call to SiteUtils.QueueIndexing(); starts a background thread with a task that processes the rows from the mp_IndexingQueue table into the actual file based search index.
So in this way the index is maintained as content is changed and it should not require rebuilding the whole index again unless there is a problem to solve, so the Rebuild Index button is not relevant to implementing search in your feature, it is only used for rebuilding the index for all content that is searchable.
Hope that helps,
Joe