11Filter Search Specifications Syntax for Oracle Secure Enterprise Search

Filter Search Specifications Syntax for Oracle Secure Enterprise Search

This chapter covers the syntax for filtering the index record-set to incorporate custom business rules. See Administering Siebel Search Index Settings for Oracle Secure Enterprise Search for information on using the Filter Search Spec field. This chapter includes the topic: Filter Search Specification Syntax.

Filter Search Specification Syntax

This topic describes the supported syntax elements for filter search specifications, which are used for filtering the index record-set. Filter search specifications are specified in the Search Definition and Search Index Settings views of the Administration - Search OSES screen.

This topic includes the following information:

    Precedence

    Precedence refers to the order in which the various search operators within the filter search query specification are evaluated. The following table shows the levels of precedence. Expressions within parentheses are evaluated first. Using parentheses can alter the order of precedence within an expression.

    Oracle’s Siebel Business Applications evaluate the expression within the parentheses first, before evaluating the expression outside.

    Level Operator

    1

    ()

    2

    NOT

    3

    AND

    4

    OR

      Comparison Operators

      The following table describes the purpose of each comparison operator, and gives an example of how it is used.

      Operator Purpose Example

      =

      Equality Text

      [Publish External] = “Y"

      >

      Inequality text

      [Role] > LookupValue (“ROLE_TYPE", “Manager")

      >

      Greater than

      [Start Date] > Today()

      Less than

      [End Date] Today() + 4

      >=

      Greater than or equal to

      [Start Date] >= Today()

      =

      Less than or equal to

      [End Date] = Today() - 4

      Note: The last four operators are used only for Date fields.

        Logical Operators

        The following table explains what a value of TRUE or FALSE means for each logical operator.

        Operator Returns TRUE Returns FALSE

        AND

        If all component conditions evaluate to TRUE

        If any component condition evaluates to FALSE

        OR

        If any component condition evaluates to TRUE

        If all component conditions evaluate to FALSE

          Pattern Matching with LIKE and NOT LIKE

          The LIKE operator is used in character string comparisons with pattern matching.

          The syntax is as follows:

          char1 LIKE char2
          

          where:

          • char1 is the value to be compared with the pattern.

          • char2 is the pattern to which char1 is compared. The NOT logical operator can be used in conjunction with LIKE to exclude patterns.

          The syntax including the NOT logical operator is one of the following:

          char1 NOT LIKE char2
          NOT (char1 LIKE char2)
          

          While the equal (=) operator does exact matching, the LIKE operator matches a portion of one character value to another. Patterns can use special characters to denote different characters. These characters are given in the following table.

          Character Purpose Example

          *

          Zero or more characters

          [Sales Type] LIKE Sales* returns all records whose [Sales Type] value starts with the characters Sales, as in Sales-Brochure, Sales-Presentation, and so on.

          ?

          One character

          [Sales Type] NOT LIKE Sale? returns all records whose [Sales Type] value was five characters long, and did not start with the letters Sales. Records with the word Sales would not be returned.

            Functions in Calculation Expressions

            Functions that can be used in the filter search specification are listed in the following table.

            Function Purpose Example

            GetProfileAttr ("[Attribute]")

            String

            Returns the value stored in the profile attribute if that attribute has been defined. Used in personalization to retrieve values of attributes in a user profile and to pass information from a script to the UI. Set a session-specific personalization attribute equal to the value of the shared global, and reference the personalization attribute in a calculated field.

            Note: For an undefined attribute or for an attribute that has not been set up, GetProfileAttr returns NULL. Search Server does not support NULL values in the query.

            LookupValue (type, lang_ind_code)

            String

            Finds a row in S_LST_OF_VAL table where the TYPE column matches the type argument, the CODE column matches the lang_ind_code argument, and the LANG_ID column matches the language code of the currently active language. Returns the display value (the VAL column) for the row. This function is used to obtain the translation of the specified untranslated value in the specified LOV into the currently active language.

            Today

            Date

            Today’s date (in the format mm/dd/yy).

            GetValidCatalogCategories()

            String

            Returns a list of valid catalog categories for the current logged in user.

              Filter Search Specification Examples

              Assigning a search expression to an object definition’s Search Specification property is similar to the predefined query’s expression; however, identifying the business component and specifying the reserved word Search is not required.

              Note: The Search Specification expression must be on one line. If more than one line is used the search specification might not be processed correctly.

              The following are examples of filter search specification syntax:

              • [Close Date] > “04/15/07"

              • [Sales Tool Type] LIKE “Cal*"

              • [Start Date] >= Today () AND [End Date] <= Today() + 100

              • [Solution Type] = LookupValue (“SOLUTION_TYPE", “Solution") AND ([Publish External] = “Y"

              • [PriceListId]=GetProfileAttr(“DefaultPriceListId")

              Note: For date formats in filter Search Specification, use the business component format. To reference a field value, you must use [Filter Field Name]. Also, string constants must be enclosed in double quotation marks (“string").

              The fields declared must exist within the designated search filter field object definition.