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 7 of 7

Thread: fulltext index

  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    fulltext index

    I've come up against another problem using searches of fulltext indexes and hope somebody can offer me a bit of advice....

    One column has a CSV list of 2, 3 & 4 character initials - for example: "BL, BT, GL, IWM, NMM, NRA, TNA,". I want to be able to search for rows that contain ANY particular initials.

    For example, I can build a string "BL, GL, TNA" with check boxes to search for all rows containing any of those initials. But mysql only indexes words of 4 or more characters by default. I've emailed my ISP to see if they can change the configuration to allow indexing of 2 character words, but I'm guessing that the answer will be "no" as it will probably require a server wide change. So is there a way around this?

    Using LIKE won't work because a LIKE search for "BL, BT, GL, IWM, NMM, NRA, TNA," will only return a row that has exactly that string, and not one that just contains BL for example. I'm a bit stumped with this one.....

  • #2
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    post your query so far and we may be able to help.


    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,631
    Thanks
    4
    Thanked 147 Times in 138 Posts
    Normalize your data instead.

  • #4
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Oh, I missed that bit where he said
    One column has a CSV list of 2, 3 & 4 character initials ....
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #5
    New Coder
    Join Date
    Mar 2009
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by guelphdad View Post
    Normalize your data instead.
    well, yes, in an ideal world. And I'll do that in the long term. I didn't make the database, so I'm not guilty there. But I need this search up quickly and normalising the data will not be quick. Should have said that to start with, anticipating the responses....

  • #6
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,631
    Thanks
    4
    Thanked 147 Times in 138 Posts
    use find_in_set

  • Users who have thanked guelphdad for this post:

    yebaws (03-24-2009)

  • #7
    New Coder
    Join Date
    Mar 2009
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by guelphdad View Post
    use find_in_set
    thank you - that's the one!


  •  

    Posting Permissions

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