SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member bobu's Avatar
    Join Date
    Apr 2003
    Location
    Timisoara, Romania
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question advanced queries

    I am workings at a site that uses MYSQL databases and I want to give users the ability to search in the site's database.

    How can I order the listings in the order of their relevance and in the same time the results to be all the results that contain "term1 term2" (including "term1 bla bla ... term2" not just the ones like "term1 term2").

  2. #2
    SitePoint Enthusiast CamelToe's Avatar
    Join Date
    May 2003
    Location
    Canada
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I would suggest looking at Full Text Search Capabilities of Mysql.
    http://www.mysql.com/documentation/m...ulltext_Search

    Basically it will allow your Searches to go much faster and you can remove words like AND, SO, etc... from your Searche Query String.
    It also allows for Boolean searches which will probably help in 'order of relevance'.

    Pay particular attention to the MATCH Command in your Query. That will give you what your after.

    Good Luck.

  3. #3
    SitePoint Member bobu's Avatar
    Join Date
    Apr 2003
    Location
    Timisoara, Romania
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you. It is the right resource but I am having a bit of a problem implementing it.

    I am using MySQL Control Center to alter the table. The table has already an index: PRIMARY. When I want to create a new fulltext index I am getting the following error message:
    [root@localhost:3306] ERROR 1005: Can't create table '.\brol_roportal\#sql-258_b.frm' (errno: 140).

    Is it because I have a blob field and if this is it how can I fix it?


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
  •