Hướng dẫn học Microsoft SQL Server 2008 part 55

Các giải pháp khác cho vấn đề tìm kiếm nhiều cột bao gồm thêm một cột bổ sung để giữ tất cả các văn bản cần tìm kiếm và sao chép dữ liệu từ các cột ban đầu cho một cột FullTextSearch trong một sau khi kích hoạt hoặc sử dụng một tồn tại cột tính toán | Part III Beyond Relational The other solution to the multiple-column search problem consists of adding an additional column to hold all the text to be searched and duplicating the data from the original columns to a FullTextSearch column within an after trigger or using a persisted computed column. This solution is not smooth either. It duplicates data and costs performance time during inserts and updates. The crux of the decision regarding how to solve the multiple-column search is the conflict between fast reads and fast writes OLAP versus OLTP. Searches with wildcards Because the full-text search engine has its roots in Windows Index and was not a SQL Server-developed component its wildcards use the standard DOS conventions asterisk for a multi-character wildcard and double quotes instead of SQL-style wildcards and SQL single quotes. The other thing to keep in mind about full-text wildcards is that they work only at the end of a word not at the beginning. Indexes search from the beginning of strings as shown here SELECT Title FROM Fable WHERE CONTAINS Hunt Result Title The Hunter and the Woodman The Ass in the Lion s Skin The Bald Knight Phrase searches Full-text search can attempt to locate full phrases if those phrases are surrounded by double quotes. For example to search for the fable about the boy who cried wolf searching for Wolf Wolf does the trick SELECT Title FROM Fable WHERE CONTAINS Wolf Wolf Result Title The Shepherd s Boy and the Wolf Word-proximity searches When searching large documents it s nice to be able to specify the proximity of the search words. Fulltext search implements a proximity switch by means of the NEAR option. The relative distance between 502 Using Integrated Full-Text Search 19 the words is calculated and if the words are close enough within about 30 words depending on the size of the text then full-text search returns a true for the row. The story of Androcles the slave who pulls the thorn from the lion s .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.