How do I use full text search across multiple tables, SQL Server 2005

前端 未结 2 1382
有刺的猬
有刺的猬 2021-02-10 02:05

I have a full text catalog with two tables in it.

tableA has 4 columns (a1, a2, a3, a4) of wich 3 are indexed in the catalog, a2,a3,a4. a1 is the primary key.

t

2条回答
  •  不思量自难忘°
    2021-02-10 02:31

    Your query only returns records, if both A and related B contains the search text.

    You do not state what does not work, though.

    Why not LEFT OUTER JOIN the fulltext searches, and replace:

    SELECT *, (ISNULL(ftTableA.[RANK], 0) + ISNULL(ftTableB.[RANK], 0)) AS total_rank 
    

    and

    WHERE ftTableA.Key IS NOT NULL OR ftTableB.Key IS NOT NULL
    

提交回复
热议问题