extending FULLTEXT searches
A FULLTEXT search is limited to one table.
What does that mean? Sorry for the newbie question.
All parameters to the MATCH function must be columns from the same table that is part of the same fulltext index, unless this MATCH is IN BOOLEAN MODE.
OK..just two more questions then
What does the "BOOLEAN" part of the restriction mean? (that's a newbie question...I know...sorry).
More importantly. How do I do what you suggested?:
In fact, what I want to do is pass the accumulated results to the paged results class that you describe in your tutorial on that subject. I have modifed the CLASS to accept results instead of queries, but I don't know how to merge the results of two separate queries into one result.
Instead, you need to search each table separately and combine the results in some intelligent fashion yourself.
For that matter, what I am wondering here is how to do table joins for FULLTEXT queries. Using your tutorial example, how would I force MySQL to only SELECT the records in a given category of jokes? The way the system works (as produced by the tutorial in your book) is that categories are determined by queries to a lookup table. This neccesitates a table join in the query, n'est-ce pas? So here is the crux of my confusion. How can I set up a query using a FULLTEXT search that is restricted to only certain categories as determined by a query to a lookup table?
The FULLTEXT search capability in MySQL is very cool, but the restrictions on it make it a pain to work with. A solution to my categories inclusion question above would make it possible to extend the CMS in your book in an extremely useful way.
Any responses will be GREATLY appreciated.:D
So how does one merge query results?
Thanks for the clarification. The ability to use table joins will be helpful, but I am still wondering how to merge results together. How do I do separate queries and then join the results together in order to pass them to things like the paged results class?
trouble joining tables in FULLTEXT search
I have tried to follow Kevin's advice by using the following query. Both tables exist and both have FULLTEXT indexes.
Here's my query:
Here's the error message:
SELECT * , MATCH (grand_summary.long_text) AGAINST ('simple') + MATCH (grammar_sections.long_text) AGAINST ('simple') FROM grand_summary, grammar_sections AS rel WHERE rel > 1 ORDER BY rel DESC;
Can anyone please tell me how to adjust this query so that I can search two tables as a table join doing a FULLTEXT search?
Unknown table 'grammar_sections' in field list