16.6 Overview of the JSON Result Set Interface
The JSON Result Set Interface (RSI) enables you to perform queries in JSON and return results as JSON, avoiding the SQL layer and requirement to work within SELECT
semantics.
The RSI uses a simple Oracle Text query or facets and a JSON result set descriptor, where the hitlist is returned in one single CLOB of JSON according to the result set descriptor. The JSON RSI uses SDATA
sections for grouping and counting.
In applications, a page of search results can consist of many disparate elements, such as metadata of the first few documents, total hit counts, and per-word hit counts. Each extra call takes time to reparse the query and look up index metadata. Additionally, some search operations, such as iterative query refinement, are difficult for SQL. If it is even possible to construct a SQL statement to produce the desired results, such SQL is usually suboptimal.
The JSON RSI is able to produce the various kinds of data needed for a page of search results all at once, thus improving performance by sharing overhead. The RSI can also return data views that are difficult to express in SQL.
The JSON RSI supports queries based on CONTEXT
and JSON search indexes. You can also perform other aggregations in facets like COUNT,
MIN,
and MAX
apart from the supported group counts. AVG
and SUM
are supported for numeric facets.