Database Search technique

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • realin
    Contributor
    • Feb 2007
    • 254

    Database Search technique

    hiya all,

    i am going to develop a big bulky search engine for one of my client. I want your suggestions to pour into before i start.

    The search would be only through database and not pages. The kind of database is local. The nature of the data is more like addresses.

    So shall i put the whole address(citynam e,pincode,count ry) into a single fulltext column or shall i consider putting them into multiple columns. Well i want to go for second option cause i would need geographical sorting.

    Is tehre some specific technique/pattern i need to follow or the fulltext searching would do it ?

    Thanks in advance :0
  • coolsti
    Contributor
    • Mar 2008
    • 310

    #2
    If you ask this question about whether all your data should be in one full text column or split up in several columns, then I would suggest you spend some time reading a book on basic database design. It will help you quite a bit, I did this at the time I started working with databases, and it gave me the insight to do decent design from the beginning.

    There are many reasons why you would rather have separate columns for separate data types. One is the efficiency of searches, if for example one was interested in searching only by one "attribute" but not the others, or if one wants to search on two or three of them using different search criteria. Sorting is another reason to have things in separate columns. I would say that in just about most cases, you would opt for separate columns, and not combined text fields.

    But do some basic database design reading, and learn a little about the concept of normalizations and basic design principles, believe me it will help.

    Comment

    • realin
      Contributor
      • Feb 2007
      • 254

      #3
      Originally posted by coolsti
      If you ask this question about whether all your data should be in one full text column or split up in several columns, then I would suggest you spend some time reading a book on basic database design. It will help you quite a bit, I did this at the time I started working with databases, and it gave me the insight to do decent design from the beginning.

      There are many reasons why you would rather have separate columns for separate data types. One is the efficiency of searches, if for example one was interested in searching only by one "attribute" but not the others, or if one wants to search on two or three of them using different search criteria. Sorting is another reason to have things in separate columns. I would say that in just about most cases, you would opt for separate columns, and not combined text fields.

      But do some basic database design reading, and learn a little about the concept of normalizations and basic design principles, believe me it will help.

      thanks for your inputs mate ..
      will try searching more on that ..
      but i still am wondering about the searching options ?

      Comment

      • coolsti
        Contributor
        • Mar 2008
        • 310

        #4
        I am wondering if your post should not better be in a database forum rather than PHP? Or are you specifically asking how to implement a search of a database in a PHP script?

        From the database side, the searching is performed by the database using the appropriate SELECT queries. From the PHP point of view, you would gather input from the user on what is to be searched for, how many items are to be shown (e.g. 25 per page), connect to the database, build the query, perform it, get the results and show it somehow.

        What is it you need to know?

        Comment

        • realin
          Contributor
          • Feb 2007
          • 254

          #5
          Originally posted by coolsti
          I am wondering if your post should not better be in a database forum rather than PHP? Or are you specifically asking how to implement a search of a database in a PHP script?

          From the database side, the searching is performed by the database using the appropriate SELECT queries. From the PHP point of view, you would gather input from the user on what is to be searched for, how many items are to be shown (e.g. 25 per page), connect to the database, build the query, perform it, get the results and show it somehow.

          What is it you need to know?
          i just wanted the input of the programmers in here upon searching technique. Like is there a faster way to do after i fire select queries. I mean doing it in conventional manner (i.e. select * from tablename where column like %keyword%) would take up lotsa memory and of course time.

          Is there something using XML ?
          was wondeirng ..

          thanks for your inputs :)

          Comment

          Working...