With Stack Overflow’s “Ask Question” feature, when I’ve finished typing the title of the question I’m asking, the area beneath the title would open up and display a list of “related questions.”
How do I implement that using jquery/JavaScript? Is there any plugin or open source code I could use for that?
I’m building a site using Django and Solr (for fulltext search). So ideally the solution would work well with those 2 technologies.
The question of how you match the questions had been asked already.
The answer of how you should implement it in AJAX is as follows:
First, implement a web service that you can query using JavaScript, that takes a question title and returns a list of questions that seem related. Let’s say the service is at http://example.com/queryRelatedQuestions, and returns a JSON object in the following form:
Second, when the user has entered the question title (
blurevent of text input), query the service like this: