SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem in boolean mode

    Hi!

    I am developing a seach engine on my site, and am trying to make it with boolean mode.

    My problem is that some of the results is based on "shirt" even that I am searching for t-shirt. How can I do this in a better way, and place the "shirt"-results later in the results?

    Code SQL:
    SELECT * , (
    ( 1.3 * (
    MATCH (
    productname
    )
    AGAINST (
    't-shirt'
    IN BOOLEAN
    MODE
    ) ) ) + ( 0.6 * (
    MATCH (
    description
    )
    AGAINST (
    't-shirt'
    IN BOOLEAN
    MODE
    ) ) )
    ) AS relevance
    FROM products
    WHERE (
     
    MATCH (
    productname, description
    )
    AGAINST (
    't-shirt'
    IN BOOLEAN
    MODE
    )
    )
    ORDER BY relevance DESC

    Thanks // Jimmit

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,336
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    did you try your query ~without~ calculating and sorting by your own relevance formula?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •