Main -> Documentation -> Database Builder – Newton -> Creating a New SiteSearch Database -> Database Description (.dsc) File: Structure and Syntax -> Term Adjacency Definitions

Term Adjacency Definitions

Term adjacency definitions allow you to create positional information about each indexed term. Positional information refers to the field and position that a term occupies in a record. Indexes that include term adjacency information can be searched using the proximity operators WITH and NEAR.

In order to have the option of building term adjacency into an index, the term adjacency definition must be initialized at the beginning of the database description (.dsc) file using the syntax noted below. Term adjacency is then invoked from the with keyword in every index's definition in which you want to incorporate adjacency information. The adjacency information is calculated and stored according to an adjacency function (adj_function) at the time that the database is built. Below is an example of an index definition that invokes term adjacency:


Index(09): plural words() from(\

/* 026 */026/01, 026/02, 026/03, 026/04, \

026/05, 026/06, 026/07, 026/08\

026/09, 026/10, 026/11\

) with(fldid, pos)

Notice that the last line of the index definition uses the with keyword to refer to the pos and fldid adjacency functions defined in the .dsc file and described in the syntax table below.

Important Note: Phrase indexes cannot use term adjacency definitions.

Syntax

char|short adj_function

Element

Description

char
short

Defines the size (in bytes) of the variable that stores the adjacency information. The values are:

  • char: 1 byte
  • short: 2 bytes
Note:

Refer to the adj_function description below for guidelines about which size value to use for your situation.

adj_function

Specifies the function available to calculate adjacency for the terms in an index. Adjacency information is then stored with each term in the index. The available functions are:

pos - Calculates the position of the term within the record. Stores the position of the term relative to the other terms in the indexed field. For example, in the title "Using Computer Information," Computer would be in position 2 and Information in position 3. The value of pos must be short.

fldid - Stores the last field id (tag path) that the term was indexed from. For example, if a term was indexed from 245/1, fldid would store that tag path. The value of fldid must be char.

Example

The information below gives you an example of a term adjacency definition to refer to as you create your .dsc file.


short pos

char fldid

The term adjacency definitions are typically included at the beginning of the .dsc file after you have defined the database identification and the database file definitions. Refer to the Database Description (.dsc) File Example to see where this definition is located in the file in relation to the other elements that you will need to include.

See Also

Creating a Database Description (.dsc) File
Database Description (.dsc) File: Structure and Syntax
Database Description (.dsc) File Example
Creating a New SiteSearch Database


[Main][Documentation][Support][Technical Reference][Community][Glossary][Search]
Last Modified: