To obtain a clustered result set, specify “fts_cluster asc” as the sort specification in the sort_by pseudo column of the query. For example:
select t1.score, t2.copy from i_blurbs t1, blurbs t2 where t1.id=t2.id and t1.index_any = "<many> <word> software" and t1.max_docs = 10 and t1.sort_by = "fts_cluster asc"
Include any of the following pseudo columns in your query to return additional clustering information:
cluster_number – contains the number of the cluster the row belongs to. Clusters are numbered starting with 1.
cluster_keywords – contains the most common words found in the cluster. The cluster_keywords column contains a null value for each row that does not fit into any cluster.
max_docs – limits the number of rows returned for each cluster. In a nonclustered query, the max_docs column limits the total number of rows that are returned in a result set.
score – contains a value of 0 to 10000. The higher the score, the closer the row is to the cluster center. A score of 0 indicates the row does not fit into any cluster. In a nonclustered query, the score column can contain a value of 0 to 100. The search engine does not return results with a score of 0. A score of 0 represents “no match” but the user never sees a score of 0.
See the sample script named sample_text_queries.sql in the $SYBASE/$SYBASE_FTS/sample/scripts directory for examples of SQL statements using clustering.