Full Text Searching 2 Tables at once using CONTAINSTABLE

Full Text Searching 2 Tables at once using CONTAINSTABLE

Post by Hutch Crai » Sun, 25 Jun 2000 04:00:00



All-

I need to search two full text indexed tables at once and I'm not sure
how to do it. I can search each table sparately without any issues like
this (I tried to shorten the SQL statement for this example):

SELECT DISTINCT
    KEY_TBL.RANK, FT_TBL.aut_topicID,
    FT_TBL.txt_topicName
FROM tbl_topics FT_TBL INNER JOIN
    CONTAINSTABLE(tbl_topics, txt_topicName, 'search-Terms-Here')
    KEY_TBL ON FT_TBL.aut_topicID = KEY_TBL.[KEY]

I need to do this, but on 2 tables at once, so the user can enter
search criteria into one place and query data from two different tables
(this is from an ASP page if that matters).

Is this possible? Any ideas?

Thanks in advance-

Hutch

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Full Text Search multiple tables at once?

I posted this in the microsoft.public.sqlserver.programming group and didn't
get any replies at all.  Adn lokoing at it, perhaps it's a datamining
question more than a programming one.  so if anyone here has any thoughts,
I'm certainly open to them.

I'm developing a Search Engine component for our company's employee
site.  We want to be able to do a general search across several Full Text
enabled tables and return results.

For example, we have two tables:

Table 1 is called Companies and stores information we've got on companies we
deal with regularly.

Table 2 is called Travel Agents and has a very different definition than
Table 1 because this table has extra columns that are not needed in Table 1.

Now, let's say a user does a search for hte word California.

Table 1 could have some companies with that word in the name of the company.
Table 2 could as well, or maybe in the description of the company.

How:

1.  would you search BOTH tables at once,
2.  Know from the resultset which row came from which table?

Now kick this up a notch as we like to say.  Let's say you're searching
four, five or even a dozen tables for this same word.  Or even better yet,
(cause this will happen) let's say you're also searching through a table
with Image columns storing PDF's.  The client app calling this is going to
be an ASP application, so from the search results page, I'll have to know
what kidn of page to send the user off to when they click on the item in the
resultset.  should it be to download a PDF?  To view a Company's details?
To view a Travel Agent's details?  Or maybe an employee?

See my problem?

Can anyone give me any good pointers on how to implement something like
this?

Thanks,
Stephajn

2. How does SQL Server uniquely identify a row in a table

3. Full Text Search across multiple tables at once?

4. Table variables as StProc parameter

5. Error while running full text query using CONTAINSTABLE

6. HAVE YOU HEARD ??? (DLI Databases)

7. Boolean search using Full Text search

8. ADO and Oracle PL/SQL stored procedures

9. RANK from full text Containstable() function

10. Using wildcards with full text searching

11. searching word docs using full text...

12. Full Text Search - Forms Used???

13. Full Text not searching properly whe using multiple columns