Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder trib4lmaniac's Avatar
    Join Date
    Feb 2004
    Location
    Cornwall, UK
    Posts
    535
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Detecting word boundarys in a search

    I have a search engine on my site using php/mysql. It works fine, but it doesn't detect word boundarys! Kind of annoying when you search for 'are' and come up with 'share'. I would like some tips on how to make it boundary sensitive. I imagine regular expressions would be useful here but I'm not very familiar with them.

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Did you think about using a Full Text search? http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html

    Not sure if there is an easy regex. Depends a bit about the sort of values you're searching in. Are they all afanumeric?
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    Regular Coder trib4lmaniac's Avatar
    Join Date
    Feb 2004
    Location
    Cornwall, UK
    Posts
    535
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Most entries would contain just letters but some may contain numbers aswell. I'll check out the link.


  •  

    Posting Permissions

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