|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ifs.search.SearchQualification | +--oracle.ifs.search.ContextQualification
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);
Field Summary | |
static java.lang.String |
ORDER_PREFIX
Searches can be ordered based on the Text Scores. |
Fields inherited from class oracle.ifs.search.SearchQualification |
LATE_BIND_OPER |
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 |
public static java.lang.String ORDER_PREFIX
Constructor Detail |
public ContextQualification()
Method Detail |
public void setQuery(java.lang.String query) throws IfsException
query
- text query expression. Is not parsed, is passed onto InterMedia;
hence user can specify any Text Query Expression. See InterMedia
documentation for details.public java.lang.String getQuery()
public void setName(java.lang.String name) throws IfsException
name
- qualification name, should be unique inside the search tree.IfsException
- if the operation fails.public java.lang.String getName()
|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |