Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.search
Class ContextQualification

    java.lang.Object

      |

      +--oracle.ifs.search.SearchQualification

            |

            +--oracle.ifs.search.ContextQualification

All Implemented Interfaces:
  java.lang.Cloneable, java.io.Serializable

public class ContextQualification
extends SearchQualification

The ContextQualification encapsulates Text Query Expressions on Document content. Under the covers we use Oracle InterMedia Search Engine to perform the query. For details on Oracle InterMedia, refer to the Oracle 8i documentation.

Briefly, a Text Query takes the form `CONTAINS(index, 'text expression', no.)>1` We expose the Text Query Expression, allowing users to specify any Intermedia Text Query Expressions. We treat the Text Query Expression as a String and pass it on to InterMedia. Additionally we allow the Text Query Expression to be late bound.

Users also specify what Medias should be searched. Medias are translated internally to Intermedia Indexes. The Medias searched, apply to all Context Qualifications in a SearchTree. Hence the Medias are specified in the ContextSearchSpecification.

We also provide a mechanism for returning Text Scores. See Intermedia documentation for details on Scores. In order to get back the Score of a Text Query Expression, the Qualification must be assigned a name. The name must be unique wrt other ContextQualifications in the same SearchTree. The SearchResultObject provides methods to retrieve Text Scores based on the Qualification Name.

Hence a ContextQualification is represented by a Text Query Expression and an optional name.

Below is an example of how to do a simple content search, using a ContextQualification.

>      // specify sort order
>      String [] ctxClauseName = {"Test1"};     // order by SCORE
>      // set DESCENDING sort order
>      boolean [] sortOrders = {false};
>      //
>      SearchSortSpecification sortSpec =
>        new SearchSortSpecification(new String[] {"DOCUMENT"}, new String[]
>                                    {ContextQualification.ORDER_PREFIX + "." +
>                                    ctxClauseName[0]}, sortOrders);
>      //
>      // create a query expression using interMedia Text query syntax
>      String searchWord1 = "hierarchy";
>      String searchWord2 = "interfaces";
>      String queryOperator = " & ";
>      String queryExpr = searchWord1 + queryOperator + searchWord2;
>      //
>      // create a ContextQualification and specify the query expression
>      ContextQualification cq = new ContextQualification();
>      cq.setQuery( queryExpr );
>      cq.setName(ctxClauseName[0]);
>      //
>      // now join with CONTENTOBJECT
>      JoinQualification jq = new JoinQualification();
>      jq.setLeftAttribute("DOCUMENT", "CONTENTOBJECT");
>      jq.setRightAttribute("CONTENTOBJECT", null);
>      //
>      SearchClause sc = new SearchClause( cq, jq, SearchClause.AND );
>      //
>      ContextSearchSpecification cp = new ContextSearchSpecification();
>      cp.setContextClassname("CONTENTOBJECT");
>      cp.setSearchClassSpecification(new SearchClassSpecification(new String[]
>      //                      {"DOCUMENT", "CONTENTOBJECT"}));
>      cp.setSearchQualification(sc);
>      cp.setSearchSortSpecification(sortSpec);
>      //
>      Search s = new Search(sess, cp);
>      //
>      s.open();
>      ...
>      s.close();

See Also:
  Serialized Form

Field Summary
`static java.lang.String` | `ORDER_PREFIX` Searches can be ordered based on the Text Scores.

Constructor Summary
`ContextQualification()` Constructs a ContextQualification.

Method Summary
`java.lang.String` | `getName()` Get the Qualification name.
`java.lang.String` | `getQuery()` Returns the text query expression
`void` | `setName(java.lang.String name)` Set the name of the Qualification.
`void` | `setQuery(java.lang.String query)` Set the Text Query Expression.

Methods inherited from class oracle.ifs.search.SearchQualification
`clone`

Field Detail

### ORDER_PREFIX

    public static java.lang.String ORDER_PREFIX

  Searches can be ordered based on the Text Scores. Users can specify ContextQualification Names in the SearchSortSpecification, but they must be prefixed by ContextQualifcation.ORDER_PREFIX, so that Search knows that this sort field should be converted to to a SCORE field in the SQL Select.

Constructor Detail

### ContextQualification

    public ContextQualification()

  Constructs a ContextQualification. There are no defaults for the Text Query and Qualification Name.

Method Detail

### setQuery

    public void setQuery(java.lang.String query)
                  throws IfsException

  Set the Text Query Expression. The expression cannot be null.
  Parameters:
    `query` - text query expression. Is not parsed, is passed onto InterMedia; hence user can specify any Text Query Expression. See InterMedia documentation for details.

### getQuery

    public java.lang.String getQuery()

  Returns the text query expression
  Returns:
    text query expression.

### setName

    public void setName(java.lang.String name)
                 throws IfsException

  Set the name of the Qualification. This name is used to specify ordering by Text Scores, and to retrieve Text Scores.
  Parameters:
    `name` - Qualification name, should be unique wrt to other Qualifications in the same Tree.

### getName

    public java.lang.String getName()

  Get the Qualification name.
  Returns:
    Qualification name.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD