Results 1 to 5 of 5
  1. #1
    Alfster is offline Member
    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0

    Default Any advice - java search algorithms which accept multiple search parameters

    Hi there

    I am working on a project where i need to be able to search through many various records each differing in many respects, such as date, item number, name and so on.

    I was wondering if anyone knows of any tutorials or resources regarding search algorithms in java, that can accept more than one search parameter and then conduct the search accordingly.

    Example: if the user only knows the date and name, they enter these two values and the search will make the best of what is given.

    Any advice or input would be greatly appreciated as I do not have a solid idea of where to start.

    Thanks in advance.

  2. #2
    Mjall is offline Member
    Join Date
    Mar 2011
    Posts
    10
    Rep Power
    0

    Default

    You could just create a search for all fields (such as date, name ... etc)
    Or
    Create one search for name, if name = blank (not known or given by user)
    then
    ask for date, so and so forth.
    Don't know if this solves you're problem but that's what I deciphered anyway.

    Mjall

  3. #3
    Alfster is offline Member
    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0

    Default

    Thanks - yes that does help quite a bit actually ( pointing me in the right direction )

    much appreciated

  4. #4
    Mjall is offline Member
    Join Date
    Mar 2011
    Posts
    10
    Rep Power
    0

    Default

    No problem

    Mjall

  5. #5
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    I recently did a program which stored information which contained a job number and an address, I allowed the user to search for anything they wanted and it would produce all the matches in a new jlist, I used a simple algorithm where i split the search term and then performed a linear search with each search term entered and returned the results.

    Let's say for example they searched by street name and job number, it would split that up into a few search terms. It would then search every items information formthe search term it was currently working on. A linear search may be a bit slow, however; I tested it on 100000 randomly generated items and got fairly quick results when searching.

    Another type of search you should look into is binary search(it does require the list to be sorted unfortunately) but it searches much faster than a linear search.

Similar Threads

  1. Using Linear Search to find multiple indexes
    By Roberto1989 in forum New To Java
    Replies: 1
    Last Post: 03-16-2011, 05:36 PM
  2. binary search...multiple datatypes?
    By TopNFalvors in forum New To Java
    Replies: 8
    Last Post: 03-15-2011, 09:03 PM
  3. Binary search tree search method
    By chopo1980 in forum New To Java
    Replies: 2
    Last Post: 12-10-2009, 02:42 AM
  4. Replies: 0
    Last Post: 10-29-2009, 10:28 AM
  5. Replies: 5
    Last Post: 08-26-2008, 04:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •