Jump to content

Archived

This topic is now archived and is closed to further replies.

neugi

MATCH query

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Yeah, you can't have an index that spans tables.

Share this post


Link to post
Share on other sites

×

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.