简体   繁体   English

全文索引设计注意事项(SQL Server 2008)

[英]Full-Text Index Design Considerations (SQL Server 2008)

My website has a requirement that the user can search a number of different tables and columns. 我的网站要求用户可以搜索许多不同的表和列。 So I'm working to implement this using full-text search. 因此,我正在努力使用全文搜索来实现这一目标。

I'd like to get some input from someone with more FTS experience on the following issues. 我想从对以下问题有更多FTS经验的人那里获取一些意见。

  1. While FTS allows you to search multiple columns from the same table in a single search, I'm not seeing an option to search multiple columns from multiple tables in a single search. 虽然FTS允许您通过一次搜索从同一表中搜索多个列,但我没有看到在一次搜索中从多个表中搜索多个列的选项。 Is this in fact the case? 实际上是这样吗?

  2. If I need multiple searches to search across multiple tables, does it make sense to put the index for each table in a different full-text catalog? 如果我需要多个搜索来跨多个表进行搜索,那么将每个表的索引放在不同的全文目录中是否有意义? The wizards seem to recommend a new catalog for larger tables, but I have no idea what "large" means in this case. 向导似乎为较大的表推荐了新的目录,但是我不知道在这种情况下“大”的含义。

  3. Finally, is there any want to order the results such that matches in one column of a table come before matches in another column? 最后,是否有必要对结果进行排序,以使表的一列中的匹配项优先于另一列中的匹配项?

1.While FTS allows you to search multiple columns from the same table in a single search, I'm not seeing an option to search multiple columns from multiple tables in a single search. 1.虽然FTS允许您通过一次搜索从同一表中搜索多个列,但我没有看到在一次搜索中从多个表中搜索多个列的选项。 Is this in fact the case? 实际上是这样吗?

A FTIndex on a single table cannot include columns from another table. 单个表上的FTIndex不能包含另一个表中的列。 So typically, you'd just have to write your query so that its making multiple searches (you alluded to this in #2). 因此,通常情况下,您只需要编写查询即可进行多次搜索(您在#2中提到过)。

Another option, would be to create an Indexed View ( see requirements ) that spans multiple tables and then build a FTIndex on top of the view. 另一种选择是创建一个跨多个表的索引视图( 请参阅需求 ),然后在该视图顶部构建一个FTIndex。 I believe this is possible, but you should test for certainty. 我相信这是可能的,但是您应该测试确定性。

2.If I need multiple searches to search across multiple tables, does it make sense to put the index for each table in a different full-text catalog? 2.如果我需要多次搜索来跨多个表进行搜索,是否有必要将每个表的索引放在不同的全文目录中? The wizards seem to recommend a new catalog for larger tables, but I have no idea what "large" means in this case. 向导似乎为较大的表推荐了新的目录,但是我不知道在这种情况下“大”的含义。

shouldn't make a difference in SQL2008 since the catalog is just a logical grouping. 因为目录只是一个逻辑分组,所以在SQL2008中不应有所作为。 You might, however, consider putting the FTIndexes on different filegroups if you have a disk-sub-system that makes sense (similar considerations to partitioning tables across filegroups on different disks...to spread the IO). 但是,如果您有一个有意义的磁盘子系统,则可以考虑将FTIndexes放在不同的文件组上(与在不同磁盘上的文件组上对表进行分区的类似考虑...以分散IO)。

3.Finally, is there any want to order the results such that matches in one column of a table come before matches in another column? 3.最后,是否需要对结果进行排序,以使表的一列中的匹配项比另一列中的匹配项先出现? I don't believe this is possible... 我不认为这是可能的...

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

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