Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is it possible to bring intellisense (autocomplete) in the search box of the website????

share|improve this question
1  
I assume you mean autocomplete, intellisense is Microsoft's implementation of it in Visual Studio. Yes it is possible. But it doesn't make sense without context - what would you like to use as auto-completion source and for which box (native, Google Search, etc)? –  Rarst Dec 15 '10 at 7:38
    
i have mba courses website, i just want that when a user comes to my website and tries to search something related to mba that person should get intellisense, for eg if i come to serach Distance MBA, and if i just type 'di' there should be a drop-down with related word like Distance-MBA etc just like google –  ntechi Dec 15 '10 at 7:53

2 Answers 2

up vote 0 down vote accepted

So you want more general autocomplete, rather than something specific (like blog tags for example)?

If you use (or will consider using) Google Custom Search (which is very popular option to replace native WP search), they made it quite easy to enable native autocomplete with it.

See:

share|improve this answer

So basically you want Google Instant on your website? That's not "Intellisense," but the functionality of the two are very similar.

The short answer to your question is: yes. But the somewhat less helpful question is: it's not easy.

Decide what you want to search

You can search anything on your site from the search box: tags, categories, custom taxonomies, page titles, post title, page content, post content, etc, etc. So if you just want people searching through the titles of your posts, just have them search through the titles.

Set up an AJAX callback

Google Instant (and similar tools) use AJAX (asynchronous JavaScript and XML) to request data from the server without reloading the page. When you're typing in the search box, Google sends the text you've entered to the server and received a list of results - these are displayed in the Google Instant results below the search bar.

You'll need to do something similar. As a visitor is typing, you'll need to dynamically send their input to a PHP function on the server and have it query the database and return a list of matches. If you're searching page titles, the function will match against page titles and return a list. You can display this in a dropdown box below the search bar.

How to actually do this

You've got three options here:

1. Wait for the exact plug-in to be built

I have yet to find a plug-in that does exactly what you're looking for. So if you're dead set on just dropping a feature into your site you'll either need to wait for someone else to do it, or hire someone to write it for you.

2. Modify an existing plugin to do what you need

I've managed to find one promising plug-in that claims this kind of functionality: WP Instant Search.

Unfortunately, WP Instant Search is designed to search against post tags and categories, not against post content or titles. To extend the functionality for your purposes, you'd need to modify the plug-in a bit.

3. Develop the feature yourself

Building your own Google Instant-like feature wouldn't be much more difficult. The basic system is already there: WordPress allows for database searches, has a jQuery backbone built in to the UI for AJAX support, and is infinitely pluggable.

I even found a very complete tutorial explaining how to build a Google Instant-like system into any PHP-powered website using jQuery: How-To Create Your Own Instant Search.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.