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


i have full text catalog 2 tables in it.

tablea has 4 columns (a1, a2, a3, a4) of wich 3 indexed in catalog, a2,a3,a4. a1 primary key.

tableb has 3 columns (b1, b2, b3, b4), 2 of indexed in catalog, b3 , b4. b1 pk of table, b2 fk tablea.

i want like

select *, (fttablea.[rank] + fttableb.[rank]) total_rank  tablea inner join tableb on tablea.a1=tableb.b2 inner join freetexttable(tablea, (a2,a3,a4), 'search term') fttablea on tablea.a1=fttablea.[key] inner join freetexttable(tableb, (b3,b4), 'search term') fttableb on tableb.11=fttableb.[key] 

but not work... can single table work, eg.

select *, (fttablea.[rank] + fttableb.[rank]) total_rank  tablea inner join freetexttable(tablea, (a2,a3,a4), 'search term') fttablea on tablea.a1=fttablea.[key] 

but never more 1 table.

could give explanation and/or example of steps required full-text search on multiple tables.

your query returns records, if both , related b contains search text.

you not state not work, though.

why not left outer join fulltext searches, , replace:

select *, (isnull(fttablea.[rank], 0) + isnull(fttableb.[rank], 0)) total_rank  

and

where fttablea.key not null or fttableb.key not null 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -