Skip navigation links

Oracle® Ultra Search Java API Reference
11g Release 1 (11.1)

B28329-02


oracle.ultrasearch.query
Class Contains

java.lang.Object
  extended by oracle.ultrasearch.query.Contains

All Implemented Interfaces:
Query

public class Contains
extends java.lang.Object
implements Query

Find documents that contains some text within its content, or its string attributes. Contains query does not apply to Date or Number attribute.

If no attribute is specified, then Contains operates on the document content, instead of any attribute. Nevertheless, a match found in the title attribute of the document will have higher score than a match in the document content.

Since:
9.0.2

Constructor Summary
Contains(StringAttribute att, java.lang.String val, InstanceMetaData instmd)
          Construct a contains query on a string attribute.
Contains(java.lang.String val, InstanceMetaData instmd)
          Construct a contains query on the document content

 

Method Summary
 java.lang.String compile()
          compile into a query string.
 java.lang.String compileForCount()
          compile into a query string for counting hits.
 java.lang.String expand(StringAttribute att, java.lang.String str, InstanceMetaData instmd, boolean boost)
          Translate an user's attribute contains query string into a text query The default translator uses + and -, see Ultra Search sample query documentation.
 java.lang.String expand(java.lang.String str, InstanceMetaData instmd)
          Translate an user query string into a text query The default translator uses + and -, see Ultra Search sample query documentation.

 

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

 

Constructor Detail

Contains

public Contains(StringAttribute att,
                java.lang.String val,
                InstanceMetaData instmd)
Construct a contains query on a string attribute.

Contains

public Contains(java.lang.String val,
                InstanceMetaData instmd)
Construct a contains query on the document content

Method Detail

compile

public java.lang.String compile()
compile into a query string.
Specified by:
compile in interface Query
Returns:
a query string representing this query.

compileForCount

public java.lang.String compileForCount()
compile into a query string for counting hits.
Specified by:
compileForCount in interface Query
Returns:
a query string representing this query.

expand

public java.lang.String expand(StringAttribute att,
                               java.lang.String str,
                               InstanceMetaData instmd,
                               boolean boost)
Translate an user's attribute contains query string into a text query The default translator uses + and -, see Ultra Search sample query documentation.
Parameters:
att - a string attribute
str - the main query string
instmd - the InstanceMetaData object
boost - true if this expansion is used to boost basic search
Returns:
the translated Oracle Text query string (contains clause)

expand

public java.lang.String expand(java.lang.String str,
                               InstanceMetaData instmd)
Translate an user query string into a text query The default translator uses + and -, see Ultra Search sample query documentation. The default implementation of "boosts" matches found in string attribute "Title" by a factor of 2. For example, if "foo" is the user's query, the a document that has one occurance of "foo" in its title attribute will have a score value at least twice that of a document that has one occurance of "foo" anywhere else.
Parameters:
str - the main query string
instmd - the InstanceMetaData object
Returns:
the translated Oracle Text query string (contains clause)

Skip navigation links

Oracle® Ultra Search Java API Reference
11g Release 1 (11.1)

B28329-02


Copyright © 2002,2008, Oracle. All Rights Reserved.