Skip navigation links

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

B28329-01


oracle.ultrasearch.query
Interface Query

All Known Implementing Classes:
AllOf, And, AnyOf, Between, Contains, CtxContains, Equals, From, GreaterThan, LessThan, Or, QueryTemplate

public interface Query

A search criteria or constraint.

Queries can be combined to form more complicated queries, using And/Or query.

Since:
9.0.2
See Also:
And, Or

Method Summary
 java.lang.String compile()
          A query must be able to compile itself into some equivalent Oracle Text query string.
 java.lang.String compileForCount()
          A query must be able to compile itself into some equivalent Oracle Text query string.

 

Method Detail

compile

java.lang.String compile()
A query must be able to compile itself into some equivalent Oracle Text query string. The query string returned is used by the 'CONTAINS' Text operator. Subclasses need to override this method with their own implementation.
Returns:
a valid Text 'CONTAINS' query string, not null.

compileForCount

java.lang.String compileForCount()
A query must be able to compile itself into some equivalent Oracle Text query string. The query string returned is used by the 'CTX_QUERY.COUNT_HITS' Text API. Subclasses need to override this method with their own implementation. NOTE: This method is needed because Text queries can be reduced for faster execution of 'COUNT_HITS'. For example, '(({A} & {B})*2, {A} | {B})' is equivalent to '({A} | {B})' for hit counting purposes, and the later is faster to execute. Since this is an optimization, it is the implementation's responsibility to ensure the query string returned finds the same number of hits as the query string returned by compile(). A trivial, albeit slow implementation of compileForCount() can return the same string as compile().
Returns:
a valid Text query string, not null.

Skip navigation links

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

B28329-01


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