Welcome Guest, Not a member yet? Register   Sign In
Here is a strange one... using FULLTEXT and LIKe together
#11

[eluser]brianw1975[/eluser]
damn, I just got schooled... any MySQL books to recommend?
#12

[eluser]txomin[/eluser]
Thank you all, guys, for your replies. It seems to me that I'm gonna have to get it working in a different way because subqueries should fail too.

I'll try to explain the problem better.

This is part of a site for academics. Professors store documents in a table. If the document is the user's own, the author column is left empty. If it is not, the author field contains the name of the... author. The real problem is that there are two FULLTEXT keys that index the author field.

So any searches using MATCH...AGAINST will fail to match the user to his (her) own documents because that field is empty. It won't matter if those documents are queried first because the subquery will eliminate them.

Yeah. It seems to me that I have to drop the author field off the FULLTEXT keys and search this column with LIKE. Another option is to keep the FULLTEXT keys but write the name of the user in the author table... which has its own problems because, believe or not, a user can change his (or her) own name. Academics!

Funny thing how, even when we have solutions, we still resist them because, somehow, we don't consider them "neat". Programmers!




Theme © iAndrew 2016 - Forum software by © MyBB