ADD_PATH

Adds a path to a path-list preference for use with the PATHLIST parameter, when creating a path-subsetting JSON search index.

You use this parameter with the PL/SQL subprogram CTX_DDL.CREATE_PATH_LIST to specify a subset of paths to include or exclude from indexing. In this way, you can choose to index only relevant paths for efficient search. The excluded fields are not indexed, and the JSON search index is not used for them when querying. Filtering out irrelevant paths from documents can reduce the amount of data indexed, thereby minimizing disk space, indexing costs, and the index creation or rebuild time.

Syntax

begin
  CTX_DDL.ADD_PATH(
    pref_name     IN    VARCHAR2,
    path_type     IN    VARCHAR2,
    path_string   IN    VARCHAR2
  );
end;

pref_name

Specify the name of the pathlist preference to which you want to add a subset of paths.

path_type

Specify the type of search to target for your JSON search index:

path_string

Specify a path to add to the specified pathlist preference.

Note: Currently, you cannot add multiple paths in a single path string. To add multiple paths, you must use the ADD_PATH parameter to specify each path.

For example:

BEGIN
  CTX_DDL.create_path_list('json_pl_incl', CTX_DDL.PATHLIST_JSON, CTX_DDL.PATHLIST_INCLUDE);
  CTX_DDL.add_path('json_pl_incl', 'TEXT',     '<path1>');
  CTX_DDL.add_path('json_pl_incl', 'TEXT',     '<path2>');
  CTX_DDL.add_path('json_pl_incl', 'NUMBER',   '<path3>');
END;
/

Examples

Related Topics