Full text practices

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Craig Stadler

    #1

    Full text practices

    I am looking for information on the proper way to code full text queries and
    more information on how they work.
    I am especially interested in how to code for multi word queries...

    for example :

    Searching for : 'today is the day'

    Select * from table1 where match field1 against ('today is the day' IN
    BOOLEAN MODE) ????
    Select * from table1 where match field1 against ('today or is or the or day'
    IN BOOLEAN MODE) ????

    What is the difference between using or not using IN BOOLEAN MODE?
    What is the best way to allow people to also search for "today is the day"
    in quotes--- literal string...

    Thanks in advance for any help.
    Craig Stadler



  • steve

    #2
    Re: Full text practices

    > I am looking for information on the proper way to code full text
    queries and[color=blue]
    > more information on how they work.
    > I am especially interested in how to code for multi word queries...
    >
    > for example :
    >
    > Searching for : ’today is the day’
    >
    > Select * from table1 where match field1 against (’today is the day’[/color]
    IN[color=blue]
    > BOOLEAN MODE) ????
    > Select * from table1 where match field1 against (’today or is or[/color]
    the or day’[color=blue]
    > IN BOOLEAN MODE) ????
    >
    > What is the difference between using or not using IN BOOLEAN MODE?
    > What is the best way to allow people to also search for "today is[/color]
    the day"[color=blue]
    > in quotes--- literal string...
    >
    > Thanks in advance for any help.
    > Craig Stadler[/color]
    Good reference:
    http://www.databasejournal.com/featu...le.php/1578331

    mysql manual had a good documentation on fulltext:
    http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html
    Binary is also explained - follow the thread in the url above.

    With fulltext, you can search for quoted strings as you have
    described.

    Please check out the links above. If your questions are not answered
    in this thread, then query again, and I will try to help.

    --
    http://www.dbForumz.com/ This article was posted by author's request
    Articles individually checked for conformance to usenet standards
    Topic URL: http://www.dbForumz.com/mySQL-Full-t...ict124191.html
    Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=413684

    Comment

    • CryingClinton

      #3
      Re: Full text practices


      [color=blue][color=green]
      > > I am looking for information on the proper way to code full text[/color]
      > queries and[color=green]
      > > more information on how they work.
      > > I am especially interested in how to code for multi word queries...
      > >
      > > for example :
      > >
      > > Searching for : today is the day?
      > >
      > > Select * from table1 where match field1 against (today is the day?[/color]
      > IN[color=green]
      > > BOOLEAN MODE) ????
      > > Select * from table1 where match field1 against (today or is or[/color]
      > the or day?[color=green]
      > > IN BOOLEAN MODE) ????
      > >
      > > What is the difference between using or not using IN BOOLEAN MODE?
      > > What is the best way to allow people to also search for "today is[/color]
      > the day"[color=green]
      > > in quotes--- literal string...
      > >
      > > Thanks in advance for any help.
      > > Craig Stadler[/color][/color]

      Select * from table1 where match field1 against ("+today +is +the +day?" IN
      BOOLEAN MODE)

      this statement requires the record contain all the 4 words.

      PS, there's no relevent value will be useful coz all record returned has all
      the words.

      Cheers, ccton


      Comment

      • steve

        #4
        Re: Re: Full text practices

        CryingClinton wrote:[color=blue][color=green][color=darkred]
        > > > I am looking for information on the proper way to code full[/color][/color][/color]
        text[color=blue][color=green]
        > > queries and[color=darkred]
        > > > more information on how they work.
        > > > I am especially interested in how to code for multi word[/color][/color][/color]
        queries...[color=blue][color=green][color=darkred]
        > > >
        > > > for example :
        > > >
        > > > Searching for : today is the day?
        > > >
        > > > Select * from table1 where match field1 against (today is the[/color][/color][/color]
        day?[color=blue][color=green]
        > > IN[color=darkred]
        > > > BOOLEAN MODE) ????
        > > > Select * from table1 where match field1 against (today or is[/color][/color][/color]
        or[color=blue][color=green]
        > > the or day?[color=darkred]
        > > > IN BOOLEAN MODE) ????
        > > >
        > > > What is the difference between using or not using IN BOOLEAN[/color][/color][/color]
        MODE?[color=blue][color=green][color=darkred]
        > > > What is the best way to allow people to also search for[/color][/color][/color]
        "today is[color=blue][color=green]
        > > the day"[color=darkred]
        > > > in quotes--- literal string...
        > > >
        > > > Thanks in advance for any help.
        > > > Craig Stadler[/color][/color]
        >
        > Select * from table1 where match field1 against ("+today +is +the[/color]
        +day?" IN[color=blue]
        > BOOLEAN MODE)
        >
        > this statement requires the record contain all the 4 words.
        >
        > PS, there’s no relevent value will be useful coz all record[/color]
        returned has all[color=blue]
        > the words.
        >
        > Cheers, ccton[/color]
        Sorry, it seems like I did not respond properly to your question, in
        my prev. post (I hope others do).

        In any case, boolean mode does not use relevancy, and what you say
        above is correct.

        In any case, most bulletin boards, etc. do not allow exact string
        searches, and it does not seem to seriously bother their users (it
        does not bother me as a user).. so I would implement that if it is a
        "must have".

        --
        http://www.dbForumz.com/ This article was posted by author's request
        Articles individually checked for conformance to usenet standards
        Topic URL: http://www.dbForumz.com/mySQL-Full-t...ict124191.html
        Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=421033

        Comment

        Working...