OWL database Text Searches

The OWL database search uses the Microsoft SQL 2000 CONTAINS predicate to conduct its searches You can search for:

Below are some examples, followed by the full syntax

Examples: what you type into the query box is underlined

A. Use  with <simple_term>

    To find all rows containing the word thrush just enter thrush in the box  

    B. Use phrase in <simple_term>

      To return all records that contain either the phrase "nest predation" or "delayed breeding" put

      "nest predation" or "delayed breeding"  in the box.
      NB throughout this note double quotes can be left out, unless you are using "Force exact syntax", which you might do if your search phrase contained a word which could be mistaken for a logical operator. If you are using quotes they must be used as shown, or errors may be thrown

      C. Use with <prefix_term>

        To return all records with at least one word starting with the prefix predat enter "predat*" in the box..  

        D. Use OR with <prefix_term>

        To return all records with nest* or predat* type "nest*" or "predat*" in the box

        E. Use <prefix_term>  with <proximity_term>

          To return all records that have the words with the prefix feed near the word variety type "feed*" near variety into the box.

          F. Use  with <generation_term>

          To return all records with words of the form feed, feeding, fed and so on type formsof (inflectional, feed) into the box  

          G. Use  with <weighted_term>

          This example searches for all product names containing the words nest, predator, or egg and different weightings are given to each word; this is of limited usefulness at present in OWL as we do not rank the hits by goodness of fit to the query; for interest, the syntax would be:

          ISABOUT (nest weight (0.6),predator weight (0.8), egg weight (0.5))

          Syntax

          CONTAINS is a predicate used to search columns containing character-based data types for precise or “fuzzy” (less precise) matches to single words and phrases, the proximity of words within a certain distance of one another, or weighted matches. In what follows, what you type into the search window is the <contains_search_condition> (without any surrounding single quotes or brackets). The following is an edited version of the SQL2000 books online entry for CONTAINS

          CONTAINS
              (    {column | *}, '<contains_search_condition>'
              )

          <contains_search_condition> ::=
                  
          {
                  | <generation_term>
                  | <prefix_term>
                  | <proximity_term>
                  | <simple_term>
                  | <weighted_term>
                  }
                  | { (<contains_search_condition>)
                  {AND | AND NOT | OR} <contains_search_condition> [...n]
                   }

          <weighted_term> ::=
              ISABOUT
                  (    {    {
                              <generation_term>
                              | <prefix_term>
                              | <proximity_term>
                              | <simple_term>
                          }
                          [WEIGHT (weight_value)]
                      } [,...n]
                  )

          <generation_term> ::=
              FORMSOF (INFLECTIONAL, <simple_term> [,...n] )

          <prefix term> ::=
              { "word * " | "phrase * " }

          <proximity_term> ::=
              {<simple_term> | <prefix_term>}
              {    {NEAR | ~} {<simple_term> | <prefix_term>} } [...n]

          <simple_term> ::=
              word | " phrase "

          Arguments
          column
          Is the name of a specific column that has been registered for full-text searching. Columns of the character string data types are valid full-text searching columns.
          *
          Specifies that all columns in the table that have been registered for full-text searching should be used to search for the given contains search condition(s). If more than one table is in the FROM clause, * must be qualified by the table name.
          <contains_search_condition>
          Specifies some text to search for in column. Variables cannot be used for the search condition.
          word
          Is a string of characters without spaces or punctuation.
          phrase
          Is one or more words with spaces between each word.

          Note Some languages, such as those in the Far East, can have phrases that consist of one or more words without spaces between them.


          <weighted_term>
          Specifies that the matching rows (returned by the query) match a list of words and phrases, each optionally given a weighting value.
          ISABOUT
          Specifies the <weighted_term> keyword.
          WEIGHT (weight_value)
          Specifies a weight value which is a number between 0.0 and 1.0. Each component in <weighted_term> may include a weight_value. weight_value is a way to change how various portions of a query affect the rank value assigned to each row matching the query. Weighting forces a different measurement of the ranking of a value because all the components of <weighted_term> are used together to determine the match. A row is returned if there is a match on any one of the ISABOUT parameters, whether or not a weight value is assigned. At present ISABOUT is not very helpful in OWL
           
          AND | AND NOT | OR
          Specifies a logical operation between two contains search conditions. When <contains_search_condition> contains parenthesized groups, these parenthesized groups are evaluated first. After evaluating parenthesized groups, these rules apply when using these logical operators with contains search conditions:
          • NOT is applied before AND.
          • NOT can only occur after AND, as in AND NOT. The OR NOT operator is not allowed. NOT cannot be specified before the first term (for example, ‘NOT “phrase_to_search_for” ‘ by itself is illegal ).
          • AND is applied before OR.
          • Boolean operators of the same type (AND, OR) are associative and can therefore be applied in any order.
          <generation_term>
          Specifies a match of words when the included simple terms include variants of the original word for which to search.
          INFLECTIONAL
          Specifies that both plural and singular forms of nouns and the various tenses of verbs are to be matched. A given <simple_term> within a <generation_term> will not match both nouns and verbs.
          <prefix_term>
          Specifies a match of words or phrases beginning with the specified text. Enclose a prefix term in double quotation marks (““) and an asterisk (*) before the ending quotation mark. All text starting with the simple term specified before the asterisk is matched. The asterisk matches zero, one or more characters (of the root word or words in the word or phrase). When <prefix_term> is a phrase, each word contained in the phrase is considered to be a separate prefix. Therefore, a query specifying a prefix term of “local wine *” matches any rows with the text of “local winery”, “locally wined and dined”, and so on.
          <proximity_term>
          Specifies a match of words or phrases that must be close to one another. <proximity_term> operates similarly to the AND operator: both require that more than one word or phrase exist in the column being searched. As the words in <proximity_term> appear closer together, the better the match.

          NEAR | ~

          Indicates that the word or phrase on the left side of the NEAR or ~ operator should be approximately close to the word or phrase on the right side of the NEAR or ~ operator. Multiple proximity terms can be chained, for example:

          a NEAR b NEAR c

          This means word or phrase a should be near word or phrase b, which should be near word or phrase c.

          <simple_term>
          Specifies a match for an exact word (one or more characters without spaces or punctuation in single-byte languages) or a phrase (one or more consecutive words separated by spaces and optional punctuation in single-byte languages). Examples of valid simple terms are “blue berry”, blueberry, and “Microsoft SQL Server”. Phrases should be enclosed in double quotation marks (““). Words in a phrase must appear in the same order as specified in <contains_search_condition> as they appear in the database column. The search for characters in the word or phrase is case insensitive. Noise words (such as a, and, or the) in full-text indexed columns are not stored in the full-text index. If a noise word is used in a single word search, SQL Server returns an error message indicating that only noise words are present in the query. SQL Server includes a standard list of noise words in the directory \Mssql7\Ftdata\Sqlserver\Config.

          Punctuation is ignored. Therefore, “computer failure” matches a row with the value, “Where is my computer? Failure to find it would be expensive.”.

          n
          Is a placeholder indicating that multiple contains search conditions and terms within them can be specified.