Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: designing mysql db to be searchable

  1. #1
    djemmers's Avatar
    djemmers is offline Newbie
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    12
    Rep Power
    0

    Question designing mysql db to be searchable

    Hi,

    I want to make a database in mysql and a website that searches in het entries.

    It will be a kind of event database for tournaments.
    with data like:
    title,description,level_age,city,date,...

    To make a database that stores those data is not that difficult. The problem is making it so that it can handle multiple languages.

    and more it really needs to be searchable for the fields
    title and description together
    level_age
    city
    date
    country
    province
    category

    I made 2 designs in DBdesigner4 if anyone could take a look at them and give me some pointers... please do.

    I would like to use php and mysql and if needed javascript and ajax to create the website/forms/resultpages...
    Attached Files Attached Files
    Last edited by djemmers; 10-08-2009 at 01:15 AM. Reason: added designs

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    phillw's Avatar
    phillw is offline Learning Programmer
    Join Date
    Aug 2009
    Location
    Northwest England (UK)
    Posts
    82
    Blog Entries
    1
    Rep Power
    0

    Post Re: designing mysql db to be searchable

    I have also set up a db that has to be searchable - I'm using a mix of FULLTEXT, parametised input & column searching (Oh, the joys of full text..)

    The test area is currently in 'debug' mode - so, if you'd like to have a look and see how it returns the search string in different circumstances, it is displaying the search query that it has carried out to create the results.

    In my case I have to be able to search for 'parts' in my case accross part-numbers, descriptions, suitable for, sizes etc.

    To get some test data to try searches with, the following pages are populated with data.
    Ignition and Door Lock Keys, Malleable Iron Fittings, Flexible Rubber Mountings, Oils and Lubricants, Pin Spanners, Stihl TS400, Partner K650/K700, and Dolmar DPC6400.

    As you are looking to search accross multiple columns, I'm reckoning you're going to have to 'dip your toe' into FULLTEXT - It's a bit wierd at first, but once you get the hang of the rules it's quite painless

    If you're going to be using foreign words, then it'll be FULLTEXT searching in BOOLEAN mode.

    The MySQL resource on the joys of this can be found at, there is also a comment on how accents interact within the search.

    MySQL :: MySQL 5.0 Reference Manual :: 11.8.2 Boolean Full-Text Searches

    If you are searching in different languages then you really must build up a stop-list for that language, else your full-text index is going to be BIG !!! The resources are within the above link.

    the link to my test area is © 2009 M.G. Judd Ltd Find Parts You're welcome to have a 'play' with differing searches - if any of the coding it returns looks like it may be of help to you, please feel free to ask !!

    Regards,

    Phill.
    Last edited by phillw; 10-21-2009 at 07:16 AM.

  4. #3
    djemmers's Avatar
    djemmers is offline Newbie
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    12
    Rep Power
    0

    Re: designing mysql db to be searchable

    thanx phillw,

    That is a big part of the info I need.
    tha data in my searchform (not working) is here: basketbal.tornooi.net/searchform.php
    It is only the concept nothing more.
    my text fields will probably be FULLTEXT searching in BOOLEAN mode.

    I don't understand your comment about
    "must build up a stop-list for that language"
    yet, but I guess that will become clear while I read everything more in depth and start coding.

    thanks a lot!

  5. #4
    phillw's Avatar
    phillw is offline Learning Programmer
    Join Date
    Aug 2009
    Location
    Northwest England (UK)
    Posts
    82
    Blog Entries
    1
    Rep Power
    0

    Re: designing mysql db to be searchable

    fulltext builds an index accross the columns which you wish to search. As we want it to be faster than doing a full mulit-column search, there are a few rules ...
    1) Words of less than 4 characters are not searched for
    2) Common words are not indexed. - This is the 'stop list', otherwise your index would be full of common words. The english stop-list is here MySQL :: The Full-Text Stuff That We Didn't Put In The Manual You will need a french version for your site.

    Phill.

    une liste de mots d'arrêt français est disponible d'ici
    (Okay, so I ran that sentence through a translator - my French isn't that good)

    French stopwords
    Last edited by phillw; 10-09-2009 at 07:53 AM. Reason: French Stop Words

  6. #5
    phillw's Avatar
    phillw is offline Learning Programmer
    Join Date
    Aug 2009
    Location
    Northwest England (UK)
    Posts
    82
    Blog Entries
    1
    Rep Power
    0

    Re: designing mysql db to be searchable

    You'll also want to set-up your fulltext index. It is considered best to put the information onto the database 1st, then create the index - else it has to rebuild the index every-time you add something !!
    I have a couple of routines to do this - Don't worry, I'm still learning & all the pitfalls that can be fallen into - I have already done !!! - lol

  7. #6
    djemmers's Avatar
    djemmers is offline Newbie
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    12
    Rep Power
    0

    Re: designing mysql db to be searchable

    tnx for the extra info!

    I am beginning to think I can do this!
    my database will be filled through user input from my visitors.
    so the fulltext index will have to be recompiled once a day or so I guess.

    djemmers

  8. #7
    phillw's Avatar
    phillw is offline Learning Programmer
    Join Date
    Aug 2009
    Location
    Northwest England (UK)
    Posts
    82
    Blog Entries
    1
    Rep Power
    0

    Re: designing mysql db to be searchable

    From what i do understand about full-text, once the index has been set-up - it will auto add records itself (I'll double check) - It is only when you do a major change to your indexing system (adding / removing search columns, adding / removing stop words, changing the ftwordmin setting (that is the one set to 4 by default etc) that it is recommended you do a fulltext index rebuild (i.e drop & create), as opposed to the 'repair' function.

    Phil.

  9. #8
    djemmers's Avatar
    djemmers is offline Newbie
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    12
    Rep Power
    0

    Re: designing mysql db to be searchable

    ah tnx.
    my database will be subject to change.
    text will be changed occasionally
    records added
    records deleted

    but no extra collums or such

  10. #9
    phillw's Avatar
    phillw is offline Learning Programmer
    Join Date
    Aug 2009
    Location
    Northwest England (UK)
    Posts
    82
    Blog Entries
    1
    Rep Power
    0

    Re: designing mysql db to be searchable

    Okies. As I've been gleaning information from various forums, I've popped all that I learned on fulltext onto MySQL Full-Text Searches - VPOLink

    The code I use is on there, fully commented - Hope it is of help

    Phill.

  11. #10
    djemmers's Avatar
    djemmers is offline Newbie
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    12
    Rep Power
    0

    Re: designing mysql db to be searchable

    that I'll read when I am that far!

    tnx
    http://www.tornooi.net toernooien lijst voor België en Nederland.

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I need Designing help.
    By 4thearth in forum Website Design
    Replies: 4
    Last Post: 11-14-2010, 07:17 PM
  2. How can I become better at designing website?
    By arianb in forum Website Design
    Replies: 4
    Last Post: 04-17-2010, 02:19 AM
  3. Need Help Designing a Program
    By toxic888 in forum Visual Basic Programming
    Replies: 4
    Last Post: 12-23-2009, 12:52 AM
  4. WebSite Designing
    By seal in forum Website Design
    Replies: 7
    Last Post: 07-24-2007, 06:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

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