优化基于ajax的搜索

I am doing a ajax based search which suggests the values from the database tables as the user inputs fields in the search box. It does work but its really very slow, takes more than 10 seconds minimum for any suggestions to load. how do I optimize this to make it fast.. Like Index it/save it in cache/crawl? Right now autoSearch() js function is fired which retrieves data from the related table to load the suggestions. how do I make this faster?

I dont know if this will make a difference but I am using grails/groovy for application development.

Thanks Priyank

Have you added an index to any searched fields (or checked in the database to make sure the examined fields are indexed)? The Grails GORM does not automatically create indices for text fields unless you add the appropriate static mapping to your domain class.