February 9, 2004 at 9:11 pm
I'm not entirely sure if this is the right place to ask this but here goes.
My company's website has a search function that searches our product database for customers. Currently we're using SQL Server's Full-Text Index to implement this functionality. I want to know if there's a better way. If there is, I want to know how to implement it. If there isn't, I would like to know how to optimize FTI.
I do realize that there's probably no "right" answer. With computers, there usually isn't. So guidelines, experiences of others, etc. would be very helpful. Also, any books on searching that I could get would also help.
Thanks for any help you can provide.
James Loesch
James C Loesch
February 10, 2004 at 1:23 am
James,
If your product database is not too big and the varchar/text fields aren't too big and the searches can be satisfied with LIKE clauses then that could be the way to go.
(notice I didn't quantify "too big". it varies. :confused
As soon as you notice significant load from scans caused by LIKE searches then it's probably time to think about full text search. But, with FT there's the overheads of extra memory and CPU requirements and decisions about when to update indexes (I recommend background updates) and all the disaster recovery and failover stuff that goes with having extra bits tacked on to SQL Server.
If you're using text fields, explore the text-in-row option.... I've seen it save plenty of SQL resources in some sites.
Cheers,
- Mark
February 10, 2004 at 9:15 am
Full-text search allows word- or phrase-based indexing of character data in Microsoft® SQL Server™ 2000 tables. Full-text search consists of these basic components:
If you are full-text indexing tables that have less than a million rows, very little performance tuning is required. If you full-text index large SQL Server tables that contain millions of rows that create large full-text catalogs, this will sustain heavy read and write activity, so you must configure SQL Server and the full-text catalogs to maximize disk I/O performance by load balancing across multiple hard disk drives. You will also need to consider hardware configurations, Microsoft Windows® 2000 or Windows NT® 4.0 system configurations, and SQL Server 2000 configurations, as well the actual location of the full-text catalogs and database files.
Hardware Considerations
Windows 2000 or Windows NT 4.0 System Configuration Considerations
SQL Server Configuration Considerations
Full-Text Indexing and Catalog Considerations
If you are attempting to limit the results from a full-text query with additional WHERE clauses, the WHERE clauses are applied after the JOIN with the SQL table results, not before. Otherwise, the result set would be incorrect because qualifying rows would be omitted from the result set without any notification to the client. To limit the results from a full-text search query, use the Top_N_Rank parameter from the CONTAINSTABLE or FREETEXTTABLE predicates.
You also may encounter Error 7619, "The query contained only ignored words" when using any of the full-text predicates in a full-text query, such as CONTAINS(pr_info, 'between AND king'). The word "between" is an ignored or noise word and the full-text query parser considers this an error, even with an OR clause. Consider rewriting this query to a phrase-based query, removing the noise word, or options offered in Knowledge Base article Q246800, "INF: Correctly Parsing Quotation Marks in FTS Queries". Also, consider using Windows 2000 Server: there have been some enhancements to the word-breaker files for Indexing Services.
There are also full-text indexing and searching considerations when determining whether to include multiple SQL tables in one full-text catalog versus one SQL table per full-text catalog. There is a trade-off between performance and maintenance when considering this design question with large SQL tables and you may want to test both options for your environment. If you choose to have multiple SQL tables in one full-text catalog, you incur the overhead of longer-running full-text search queries as well because incremental populations will force the full-text indexing of all other SQL tables in that full-text catalog. If you choose to have a single SQL table per full-text catalog and have multiple SQL tables full-text indexed, you have the overhead of maintaining separate full-text catalogs with a total limit of 256 full-text catalogs per server.
©1988-2000 Microsoft Corporation. All Rights Reserved.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply