4 Replies Latest reply on Jan 29, 2013 5:07 PM by solaguide

    Please I need an Java API to implement saved-search feature.

    solaguide

      Hi everyone,

       

      I have been assign a task of implementing saved-search feature into our new project.

      This functionality will enable user to save their searches and execute them later.

      I will also be happy if someone can point me to a good tutorial on how to go about it.

      Thanks in advance.

        • 1. Re: Please I need an Java API to implement saved-search feature.
          peterj

          Any tutorial on storing data in a database should do. You probably need a table with 2 or 3 columns: userid, timestamp, searchText. The timestamp is used if you want to limit the number of stored searches (remember only the last 10 searches) you will be able to determine which search to delete when the user enters the 11th search.

          • 2. Re: Please I need an Java API to implement saved-search feature.
            solaguide

            Thank you Peter. What's the benefit of limiting the number of stored searches?

            • 3. Re: Please I need an Java API to implement saved-search feature.
              peterj

              Do you have anyone doing the UI design work for you? UI design work is a very unique field and requires that you view the system as someone who will be using it for day-to-day tasks. That person could answer part of this question. But here is my take: How useful would the user find having all their searches saved? Let's say that the user does 20 different searches each day (yes, the user might repeat some of the searches, but let's say that 20 of the end up being unique - never used before). How many unique searches will the user have done by the end of the month? By the end of the year? After 3 years? After one month, do you really want to give to the user the last 600 searches to choose from? At that point the user won't even bother to look at the sreahces and if they are not in the top couple of slot will ignore them and just retype them. You could, of course, offer smart search completion where you reduce the selections down based on when the user types so far (much like google does). The important lesson here is to not overload the user with choices - the user can handle only so much at once. So keep the list small.

               

              Second, why would you want to waste database space hanging onto a search item that the user hasn't used for 3 years? You might think, "no big deal, its only one entry in the table." But you have thousands of users and they each have hundreds of searches that they haven't used in over, say, three months. That could easily be 80% of the size of your db table. And the larger the db table is the slower the access. So you want to periodically purge stuff that is no longer relevant so that you search handling is performant.

              1 of 1 people found this helpful
              • 4. Re: Please I need an Java API to implement saved-search feature.
                solaguide

                You've said it well. You are the best. Thanks for your help and time taken.