Stored Query Expression (SQE)
Use the SQE operator to call a stored query expression created with the CTX_QUERY.STORE_SQE procedure.
Stored query expressions can be used for creating predefined bins for organizing and categorizing documents or to perform iterative queries, in which an initial query is refined using one or more additional queries.
Syntax
| Syntax | Description |
|---|---|
| SQE(SQE_name) | Returns the results for the stored query expression SQE_name. |
Examples for SQE Operator
To create an SQE named disasters, use CTX_QUERY.STORE_SQE as follows:
begin
ctx_query.store_sqe('disasters', 'hurricane or earthquake or blizzard');
end;
This stored query expression returns all documents that contain either hurricane, earthquake or blizzard.
This SQE can then be called within a query expression as follows:
SELECT SCORE(1), docid FROM news
WHERE CONTAINS(resume, 'sqe(disasters)', 1)> 0
ORDER BY SCORE(1);
Limitations
Up to 100 stored query expressions (SQEs) can be stored in a single Text query. If a Text query has more than 100 SQEs, including nested SQEs, then the query fails and error DRG-50949 is raised.