🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.golive.dynamic.content
8 messages
8 total messages Started by Jeremy_M._Cox Thu, 29 Jul 2004 01:43
Is it possible to do a full text match with joined tables.
#101
Author: Jeremy_M._Cox
Date: Thu, 29 Jul 2004 01:43
7 lines
1834 bytes
I have 2 tables one with college faculty and one with course information. I have a third table (a table of courses offered in the fall) that is related to the other two by faculty_ID and class_ID respectively. I set up the indexes on the first two tables and I can do match searches for them in MySQL. The only information in the third table that some one would be interested in is the who the instructor is (represented by the faculty_ID) and what class it is(represented by the class_ID). Since these are integers I can't do a full text matching on those fields .

I tried joining and adding the $where clause like so

// SELECT * FROM faculty_info, comm_classes, fall_classes WHERE faculty_info.faculty_ID = fall_classes.faculty_ID and comm_classes.class_id =fall_classes.class_ID and MATCH (faculty_info.faculty_first, faculty_info.faculty_last, comm_classes.class_name, comm_classes.cat_num, comm_classes.class_desc, comm_classes.prog_study) AGAINST ("Joan, Atkins")

but I get the error #1210 Wrong arguments to MATCH. I tried putting the Match statement first but it didn't work either. Is this possible or am I wasting my time?
Re: Is it possible to do a full text match with joined tables.
#102
Author: Jerry_Artman
Date: Thu, 29 Jul 2004 11:26
8 lines
954 bytes
Jeremy

In reading the mysql manual, it doesn't appear to allow joins.

It looks like a multi-step process to me.

find the faculty ids using match.
then lookup the classes using where faculty_id in list of the first match set.
Re: Is it possible to do a full text match with joined tables.
#104
Author: Jeremy_M._Cox
Date: Thu, 29 Jul 2004 15:57
15 lines
1585 bytes
Jerry,
Thanks again for the response....

Could you give me a nudge in the right direction.

Option 1. According to the MySQL manual you can use nested select statements. Are you suggesting that I use those.

Option 2 According to your tutorial you use a custom function called $where. Can I make two where functions (ie $where_1 & $where_2) where $where_1= " WHERE MATCH (faculty_info.faculty_first, faculty_info.faculty_last) AGAINST ("'.$_POST['matchString'].'")";
and $where_2= "WHERE MATCH (comm_classes.cat_num, comm_classes.class_name, comm_classes.class_desc, comm_classes.prog_study) AGAIST ("'.$_POST['matchString'].'")";

Then put both in the CS Wrap?

Option 3 "Go away kid you make no sense," Jerry thinks to him self.

Thanks again...
Re: Is it possible to do a full text match with joined tables.
#105
Author: Jerry_Artman
Date: Thu, 29 Jul 2004 17:54
7 lines
1551 bytes
I guess I am a little confused. I garnered from the example that you key words were the profs names. aka Joan, Atkins. I wasn't expecting them to be in the classes names or descriptions. It seems like you want to search on prof name and class description?

If all that is missing in the course table is the name of the prof, I would create a field like, scheduled prof and once assigned, populate it upon assignment.

Otherwise you do two searches and save the keys - courses and profs. then use the keys to add the two into one temp table.

The problem I see is applying the match against both parts of the relation while still trying to tie keys for course-prof also. You have a many to many relationship with a one to one mixed. Many to Many are those with key word matches, one to one are the course-prof combo.
Re: Is it possible to do a full text match with joined tables.
#106
Author: Jeremy_M._Cox
Date: Thu, 29 Jul 2004 19:42
5 lines
1693 bytes
Wow Jerry. Just wow. My head is spinning. I am gonna try to break down what you said. But in the mean time. Here is the function of the search.

A student would go to the current_classes page and search by instructor name to see what fall classes the instructor is teaching. Or maybe they just want to search for the classes by class name or catalog number to see what classes are being offered. And finally maybe they want to search for classes in a program of study for example Advertising. All this could be done if I use the search column by column but I don't get the advantages of full text search. If someone types in first and last name of an instructor it would return no results. Or if they type in class name and catalog number likewise.

I hope this makes sense. I just want to search this one table. Unfortunately it has joins and I must suffer for using relational capabilities. How often are tables not using joins. Seems like it would have these capabilities. Buy who am I? Thanks a lot, Jerry.
Re: Is it possible to do a full text match with joined tables.
#108
Author: Jerry_Artman
Date: Fri, 30 Jul 2004 13:36
5 lines
1402 bytes
It looks like you want one text line to search all fields in multiple tables. Like we think, I do not beleive it possible in mySQL although posing it on their list might prove more worthy. It just seems to me that the way the fulltext index is setup it creates one file of the words and it can't deal with the file in the second table because it is a separate file. I think that's why all full-text indices must be made at the same time.

Since only prof names are in the one search I would have two areas, one for profs and one for course data. Perhaps a radio button to choose staff/courses near a single text area?

I might have just a list of profs. A click on one brings up the list of classes to make life even easier.
Re: Is it possible to do a full text match with joined tables.
#111
Author: Jerry_Artman
Date: Thu, 05 Aug 2004 11:29
6 lines
735 bytes
Jeremy,

Did you figure out a solution?
Was just wondering...

Jerry
Re: Is it possible to do a full text match with joined tables.
#115
Author: Jeremy_M._Cox
Date: Sat, 07 Aug 2004 22:56
2 lines
843 bytes
Sorry Jerry,
I've been busy. I still have to post the question on the MySql website. But I will post it as soon as I find out or figure it out.... or if I figure it out.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads