Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3342482
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:50:38+00:00 2026-05-18T00:50:38+00:00

This question is easy people. Make autocomplete beautiful in the client side of a

  • 0

This question is easy people. Make autocomplete beautiful in the client side of a web app is simple. There are a lot of plugins.

But, in the backside, in the server side, what’s the best way to do it? I don’t like the idea to hit the DB with each keypressed by the user.

I’ve been thinking about sphinx, or some full-text search engine running parallel from your site.

For example, if i have a PHP (high traffic) web site, i can create a parallel python script that get http requests from my “autocomplete textboxes”. Then, when a user is pressing a key in the client side, the AJAX requests are directed to that python script that can use a special strategy.

What’s your aproach?

Some conventions:

  • Try not to hit the DB. I mean, get
    the request and do something SELECT *
    FROM foo WHERE bar LIKE “req%” is not
    a good answer. It may be a good
    strategy, but i know how to do it.*
  • Replicated data can be a good choice.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:50:38+00:00Added an answer on May 18, 2026 at 12:50 am

    I do agree that you need to have some better solution. Apache solr has a “suggestion” feature that you can use pretty well. If your data set is small then put all the data in memory and just do a simple loop.

    On the front end, I recommend using setTimeout() to wait for about 200ms before firing the ajax call. If in that 200ms, another keystroke is triggered, then cancel the last timeout and start another one. This is a really clean solution where it wouldn’t hit the db with each keystroke. I have used it in the past and it works really well.

    This explains solr with jquery and how to create an autocomplete really well.
    http://www.mattweber.org/2009/05/02/solr-autosuggest-with-termscomponent-and-jquery/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sure there is an easy answer to this question, but for the life
As a follow up to this question: Is there an easy way to pickle
I know a lot of people have asked this question, but I still will
I think this might be a fairly easy question. I found a lot of
Sorry, I know this question is easy, but I don't know how to get
Bit of a javascript newbie so not sure if this question is easy or
Sorry if this question is very easy, but I can't find the answer anywhere.
Im sure this question is so easy for all you experts, but I am
I'm definitive new on Dynamic CRM 2011, so maybe this question is really easy.
This question is in regards to this blog entry. https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ All the way at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.