
Chapter 5: Writing Full-Text Search Queries
Pseudo columns in the index
table
Pseudo columns are columns in the index
table that define the parameters of the search and provide access
to the results data. See “The index table”. These columns are valid only
in the context of a query; that is, the information in the columns
is valid only for the duration of the query. If the query that follows
contains a different set of parameters, the pseudo columns contain
a different set of values.
Each pseudo column in an index table describes a different
search attribute. For example, if you indicate the score column,
the query displays only the result set that falls within the parameters
you define. For example, the following query displays only the results
that have a score value greater than 90:
index_table_name.score > 90
Other pseudo columns (like highlight) are
used to retrieve data generated by Verity for a particular document. Table 5-1 describes the pseudo
columns that are maintained by the Enhanced Full-Text Search engine.
Table 5-1: Enhanced Full-Text Search engine pseudo
columns
Pseudo column name
|
Description
|
Datatype
|
Length (in bytes)
|
cluster_number
|
Contains the cluster that
the row is part of. Clusters are numbered starting with 1. You can
use the cluster_number column only
in the select clause of a query.
|
int
|
4
|
cluster_keywords
|
Contains the keywords that
Verity uses to build the cluster. You can use cluster_keywords only
in the select clause of a query.
|
varchar
|
255
|
highlight
|
Offsets within the document
all words from the query. You can use highlight only
in the select clause of a query.
|
text
|
16
|
id
|
Uniquely identifies a document
within a collection. Used to join with the IDENTITY column
of the source table. You can use id in
the select clause or where clause
of a query.
|
numeric
|
6
|
index_any
|
Provides a Verity language
query to the Enhanced Full-Text Search engine. You can use index_any only
in a where clause. Although the pseudo-column
is defined as char(255),the maximum length
of the index_any clause
is 16000.
|
varchar
|
255
|
max_docs
|
Limits results to the first n documents,
based on the default sort order. In a clustered result set, limits
results to the first n documents in each cluster.
You can use max_docs only
in a where clause.
|
int
|
4
|
score
|
The normalized measure of
correlation between search strings and indexed columns. The score associated
with a specific document has meaning only in reference to the query used
to retrieve the document. You can use score in
a select clause or a where clause.
|
int
|
4
|
sort_by
|
Specifies the sort order
in which to return the result set.
The Enhanced Full-Text Search engine allows up to 16 sort
specifications in the sort_by column.
You can use sort_by only
in a where clause.
|
varchar
|
35
|
summary
|
Selects summarization data.
You can use the summary column only
in the select clause of a query.
|
varchar
|
255
|
total_docs
|
Contains the total number
of documents that matched teh search criteria.
|
int
|
4
|
The following sections describe the functionality of the pseudo
columns.
Copyright © 2005. Sybase Inc. All rights reserved.
|
|
View this book as PDF 