How do i write this query for search in full text mode

Discussion in 'Databases' started by mumfry, Aug 23, 2010.

  1. #1
    hello

    i would like to take this query
    "select * from vidz where 'title' like '%test%' and videos like '%new%' ";

    instead i would like it to be a full text search query.
    am having problems combining the two searches into one fulltext query
    if it was one query i would just do it like so
    "SELECT * FROM vidz WHERE MATCH(title) Against ('test'); this one would return all title with word test in it
    or
    "SELECT * FROM vidz WHERE MATCH(videos) Against ('new'); this one would return all videos with word new in it

    But what i would like to do is get a result only if both are true.
    how can i get it all in one fulltext query

    any help would be very much appreciated
    Thanks
     
    mumfry, Aug 23, 2010 IP
  2. georgiivanov

    georgiivanov Member

    Messages:
    62
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    25
    #2
    Use boolean mode:
    SELECT * FROM vidz WHERE MATCH(title) Against ('+test +new' IN BOOLEAN MODE)
     
    georgiivanov, Aug 24, 2010 IP
  3. mumfry

    mumfry Active Member

    Messages:
    118
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3
    that query is ok
    but it doesn't search videos column
    the way am using this query is that its coming from a search filter, with radio buttons. so if two buttons are selected, lets say videos and title are selected
    then we search title for the query entered in the search bar and videos for new
    am not sure if this is at all possible with full text searching but if it is then that would be great
     
    mumfry, Aug 24, 2010 IP