Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Problem with MySQL Full-Text Search

Problem with MySQL Full-Text Search

Scheduled Pinned Locked Moved Database
databasemysqlregexhelp
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    I am using the following statement:

    SELECT * FROM patients WHERE MATCH(full_name) AGAINST('jassim ali' WITH QUERY EXPANSION) ORDER BY full_name;

    what I want to display all records contains jassim and should also contains ali but getting totally different result! here are names I am getting in the result:

    Abdul Rahma Salma
    Ali Jassim
    Jassim Rahma
    Jassim Rahma
    Mohd Ali Ahmed
    Mohd Jassim Maki

    B 1 Reply Last reply
    0
    • J Jassim Rahma

      I am using the following statement:

      SELECT * FROM patients WHERE MATCH(full_name) AGAINST('jassim ali' WITH QUERY EXPANSION) ORDER BY full_name;

      what I want to display all records contains jassim and should also contains ali but getting totally different result! here are names I am getting in the result:

      Abdul Rahma Salma
      Ali Jassim
      Jassim Rahma
      Jassim Rahma
      Mohd Ali Ahmed
      Mohd Jassim Maki

      B Offline
      B Offline
      Bernhard Hiller
      wrote on last edited by
      #2

      Never tried that. But I guess, and AND with two clauses could do the trick:

      SELECT *
      FROM patients
      WHERE MATCH(full_name) AGAINST('jassim' WITH QUERY EXPANSION)
      AND MATCH(full_name) AGAINST('ali' WITH QUERY EXPANSION)
      ORDER BY full_name;

      Please try, and report failure or success.

      J 1 Reply Last reply
      0
      • B Bernhard Hiller

        Never tried that. But I guess, and AND with two clauses could do the trick:

        SELECT *
        FROM patients
        WHERE MATCH(full_name) AGAINST('jassim' WITH QUERY EXPANSION)
        AND MATCH(full_name) AGAINST('ali' WITH QUERY EXPANSION)
        ORDER BY full_name;

        Please try, and report failure or success.

        J Offline
        J Offline
        Jassim Rahma
        wrote on last edited by
        #3

        I tried it but still the same problem. I am getting result which has no relation to the string entered! here is my result:

        Abdul Rahma Salma
        Ali Jassim
        Jassim Rahma
        Jassim Rahma
        Mohd Jassim Maki

        because it's returning Jassim OR Rahma but I want Jassim AND Rahma

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups