简体   繁体   English

在联合视图中使用SQL Server全文搜索

[英]Using SQL Server Fulltext Search with a Union View

I have a view which combines two tables via UNION ALL . 我有一个视图,通过UNION ALL了两个表。 The view is also schemabound, if that matters ( WITH SCHEMABINDING ). 如果很重要的话,该视图也是架构绑定的( WITH SCHEMABINDING )。

Is it possible to enable fulltext search on this view? 是否可以在此视图上启用全文搜索? I understand that Fulltext Search requires a unique index, but I can't create it because of UNION . 我了解全文搜索需要一个唯一的索引,但是由于UNION而无法创建它。

Is there another way to make Fulltext Search work on the view? 还有其他方法可以使全文搜索在视图上工作吗?

You could always fulltext search on the component table, and then use other data from that table (id) to get the row back out of the UNION. 您始终可以在组件表上进行全文搜索,然后使用该表(id)中的其他数据将行移出UNION。 Unless, of course, what you're fulltext searching on is composited out of the component rows, in which case this won't help you. 除非,当然,除非您要进行全文搜索的内容是从组件行中合成出来的,否则这种情况将无济于事。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM