Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | 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.io.Serializable, java.lang.Cloneable

    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 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.

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.

>      //
>      // Usage Examples
>      //

>      //
>      // Simple, document contains the word "FOO"
>      // CONTAINS('FOO')
>      //
>      ContextQualification cq1 = new ContextQualification();
>      cq.setQuery("FOO");
>      // Name is needed to identify results in Sort.
>      String contextClauseName = "CQ1";
>      cq.setName(contextClauseName);
>      //
>      // This part shows sorting based on context score
>      // Notice that the contextClauseName used in CQ, is also
>      // used to sort based on the score of the CQ.
>      //
>      SearchSortSpecification sortSpec;
>      sortSpec.add(Document.CLASS_NAME, ContextQualification.ORDER_PREFIX+"."+ctxClauseName, true);
>      //
>      // Since content is stored in CONTENTOBJECT, remember to
>      // add CONTENTOBJECT to the SearchClassSpecification and then
>      // join DOCUMENT and CONTENTOBJECT classes.
>      //
>      // Following code segment shows mandatory JoinQualification required
>      // for all searches with ContextQualification in them.
>      // This assumes, CONTENTOBJECT hold sthe actual content of the document.
>      // Use the SearchClause.AND operator to attach the following
>      // JoinQualification to the search tree.
>      //
>      // This results in following join condition in the query.
>      // DOCUMENT.ContentObject = ContentObject.ID
>      //
>      JoinQualification jq1 = new JoinQualification();
>      jq1.setLeftAttribute(Document.CLASS_NAME, Document.CONTENTOBJECT_ATTRIBUTE);
>      // Using null indicates that the join is being done on the ID.
>      jq1.setRightAttribute(ContentObject.CLASS_NAME, null);

See Also:
  Serialized Form
(Published)

Field Summary
`protected int[]` | `m_CurrentClauseNums` Set during SQL geneartion, for each Searched Media.
`protected java.lang.String[]` | `m_CurrentColumns` Set during SQL generation, for each Searched Media.
`protected java.lang.String` | `m_Name` Set this attribute, if you want to order results by SCORES or retrieve scores of this query.
`protected java.lang.String` | `m_Query` The InterMedia Text Query.
`protected java.lang.String` | `m_TableName` Set during SQL generation, for each Searched Media.
`static java.lang.String` | `ORDER_PREFIX` Searches can be ordered based on the Text Scores.
`protected static java.lang.String` | `QUALIFIER_NAME` Name used in Exception strings.

Fields inherited from class oracle.ifs.search.SearchQualification
`LATE_BIND_OPER`

Constructor Summary
`ContextQualification()` Constructs a ContextQualification.

Method Summary
`protected void` | `accept(oracle.ifs.search.SearchQualificationVisitor v)` Accepts a SearchQualificationVisitor.
`java.lang.String` | `getName()` Get the Qualification name.
`java.lang.String` | `getQuery()` Returns the text query expression
`protected boolean` | `isLateBound()` Checks if Qualification is Late Bound.
`protected void` | `setCurrentMedia(java.lang.String tab, java.lang.String[] cols, int[] nums)` This function is called from the setMediaVisitor.
`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`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### QUALIFIER_NAME

    protected static java.lang.String QUALIFIER_NAME

  Description copied from class: `ContextQualification`
  Name used in Exception strings.

  (Unpublished)

### ORDER_PREFIX

    public static java.lang.String ORDER_PREFIX

  Description copied from class: `ContextQualification`
  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.

  (Published)

### m_Query

    protected java.lang.String m_Query

  Description copied from class: `ContextQualification`
  The InterMedia Text Query.

  (Unpublished)

### m_Name

    protected java.lang.String m_Name

  Description copied from class: `ContextQualification`
  Set this attribute, if you want to order results by SCORES or retrieve scores of this query.

  In the SortSpecification specify the SortAttribute as: CONTENTORDER.m_Name. So, if CQ1.m_Name = 'DataBases' , in the SortSpecification 'CONTENTORDER.DataBases' is valid, and the results will be sorted based on the scores of this clause.

  The SearchResult will contain the scores for this query. Scores can be retrieved by calling getScore(ContextQueryName).

  (Unpublished)

### m_CurrentColumns

    protected transient java.lang.String[] m_CurrentColumns

  Description copied from class: `ContextQualification`
  Set during SQL generation, for each Searched Media. Represents the COntext Indexes to query. A CONTAINS is generated for each column.

  (Unpublished)

### m_CurrentClauseNums

    protected transient int[] m_CurrentClauseNums

  Description copied from class: `ContextQualification`
  Set during SQL geneartion, for each Searched Media. Represents the Clause Number to use in each CONTAINS expression.

  (Unpublished)

### m_TableName

    protected transient java.lang.String m_TableName

  Description copied from class: `ContextQualification`
  Set during SQL generation, for each Searched Media. Represents current Media's table.

  (Unpublished)

Constructor Detail

### ContextQualification

    public ContextQualification()

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

  (Published)

Method Detail

### setQuery

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

  Description copied from class: `ContextQualification`
  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.
  Throws:
    `IfsException`
  (Published)

### getQuery

    public java.lang.String getQuery()

  Description copied from class: `ContextQualification`
  Returns the text query expression

  Returns:
    text query expression.
  (Published)

### setName

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

  Description copied from class: `ContextQualification`
  Set the name of the Qualification. This name is used to specify sorting by Context Scores, and to retrieve Context Scores.

  Parameters:
    `name` - qualification name, should be unique inside the search tree.
  Throws:
    `IfsException` - if the operation fails.
  (Published)

### getName

    public java.lang.String getName()

  Description copied from class: `ContextQualification`
  Get the Qualification name.

  Returns:
    Qualification name.
  (Published)

### isLateBound

    protected boolean isLateBound()

  Description copied from class: `ContextQualification`
  Checks if Qualification is Late Bound. An ContextQualification is LateBound if the value is not null and is equal to the LATE_BIND_OPER.

  Overrides:
    `isLateBound` in class `SearchQualification`
  Returns:
    true if AQ is lateBound, false otherwise.
  (Unpublished)

### setCurrentMedia

    protected void setCurrentMedia(java.lang.String tab,
                                   java.lang.String[] cols,
                                   int[] nums)

  Description copied from class: `ContextQualification`
  This function is called from the setMediaVisitor. A subsequent getSQL will use this information to generate the SQL based on this information. See ContextSearchSpecification & SQLGenerator for details on how SQL is generated.

  Parameters:
    `tab` - current media's table
    `cols` - current media's Text columns
    `nums` - clause numbers to use for current columns
  See Also:
    `ContextSearchSpecification`, `SQLGenerator`
  (Unpublished)

### accept

    protected void accept(oracle.ifs.search.SearchQualificationVisitor v)
                   throws IfsException

  Description copied from class: `ContextQualification`
  Accepts a SearchQualificationVisitor. Calls visitContextQualifier on the visitor. The code in visitContextQualifier is specific to the Visitor.

  Specified by:
    `accept` in class `SearchQualification`
  Parameters:
    `v` - SearchQualificationVisitor
  Throws:
    `IfsException` - thrown if Visitor code throws.
  (Unpublished)

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