Jump to content

MATCH query


neugi

Recommended Posts

Hi,

i've written this query:
[code]SELECT h.id, h.kbeschreibung, hf.text
FROM hauser AS h
LEFT JOIN haus_fertigarten AS hf ON h.id = hf.hid
WHERE MATCH (h.kbeschreibung, hf.text) AGAINST ('Loretto' IN BOOLEAN MODE)[/code]

with this i get no result

if i use it like this it works
[code]SELECT h.id, h.kbeschreibung, hf.text
FROM hauser AS h
LEFT JOIN haus_fertigarten AS hf ON h.id = hf.hid
WHERE MATCH (h.kbeschreibung) AGAINST ('Loretto' IN BOOLEAN MODE) OR MATCH (hf.text) AGAINST ('Loretto' IN BOOLEAN MODE)[/code]

maybe somebody can tell me why my first don't work

thx
Link to comment
Share on other sites

To perform the first query you need to have a FULLTEXT index on both columns in the order supplied to MATCH
ie
[code]
ALTER TABLE tablename ADD FULLTEXT(col1,col2);
[/code]
However, since the two columns are in different tables I don't think you can do that.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.