Full text search application (3)

zhaozj2021-02-11  192

ContainStable Syntax We usually use ContaInstable in the FROM clause, just like this: select * from table_name, containTable (fulltext_table, fulltext_column, 'search condition') Where ....... ContainStable is almost the same as Contains in the query mode, so it will not be described later. ContainStable returns a table that meets the query condition. In the SQL statement, we can use it as a normal table. Let's take an example, compare the difference between these two tables. SELECT FT_TBL.student_name, FT_TBL.student_score, KEY_TBL.RANKFROM report AS FT_TBL INNER JOIN CONTAINSTABLE (student, address, 'ISABOUT (city weight (.8), county wright (.4))') AS KEY_TBL ON FT_TBL.student_id = KEY_TBL [Key] Order by key_tbl.rankcontainStable The table returned with special two columns: key, rank. In the first part we emphasized: the table that is fully indexed must have a unique index. This unique index column becomes KEY in the returned table. We usually use it as a condition for the table. When some websites search, the results indicating the degree of matching are similar in the result, and the Rank is similar. Its value is between 0 to 1000, identifying the degree of matching each line and query conditions, the higher the degree, the value of the RANK is large, and in the case of the descending order of RANK. Freetext syntax FreEtext is similar to contains, but there is not a high accuracy of Contains. In Contains, there are many requirements for the writing of query conditions, while Freetext is not, can be any word, phrase or sentence. Look at the following example: Select CategoryNameFrom Categorieswhere Fretext (Description, 'Swetest Candy Bread and Dry Meat') FreetextTable Syntax and ContainStable, FreetextTable returns a table with key, rank.

转载请注明原文地址:https://www.9cbs.com/read-4204.html

New Post(0)