ALTER INDEX

Use the ALTER INDEX SQL statement to modify an existing hybrid vector index.

Note:

Renaming hybrid vector indexes using the ALTER INDEX RENAME syntax is not supported.
  • To rebuild all parts of a hybrid vector index:

    Use the following syntax to rebuild all parts of a hybrid vector index (both Oracle Text index and vector index) with the original preference settings:

    Syntax:

    ALTER INDEX index_name REBUILD [PARALLEL n];

    Note that you do not need to specify any PARAMETERS clause when rebuilding both parts of a hybrid vector index.

    Example:

    ALTER INDEX my_hybrid_idx REBUILD;
    
    SELECT (select id from doc_table where rowid = jt.doc_rowid) as doc,
           jt.chunk
    FROM JSON_TABLE(
             DBMS_HYBRID_VECTOR.SEARCH(
               json(
                 '{ "hybrid_index_name" : "my_hybrid_idx",
                    "vector" : 
                     { "search_text"    : "vector based search capabilities",
                       "search_mode"    : "CHUNK"
                     },
                    "return" : 
                     { "topN"           : 10 }
                 }')
               ),
               '$[*]' COLUMNS doc_rowid  PATH '$.rowid',
                              chunk      PATH '$.chunk_text') jt;
  • To rebuild only the vector index part:

    Use the following syntax to rebuild only the vector index part of a hybrid vector index with the original preference settings:

    Syntax:

    ALTER INDEX index_name REBUILD 
      PARAMETERS('update vector index') [PARALLEL n];

    Example:

    ALTER INDEX my_hybrid_idx REBUILD 
      PARAMETERS('update vector index') PARALLEL 3;
    
    SELECT (select id from doc_table where rowid = jt.doc_rowid) as doc,
           jt.chunk
    FROM JSON_TABLE(
             DBMS_HYBRID_VECTOR.SEARCH(
               json(
                 '{ "hybrid_index_name" : "my_hybrid_idx",
                    "vector" : 
                     { "search_text"    : "vector based search capabilities",
                       "search_mode"    : "CHUNK"
                     },
                    "return" : 
                     { "topN"           : 10 }
                 }')
               ),
               '$[*]' COLUMNS doc_rowid  PATH '$.rowid',
                              chunk      PATH '$.chunk_text') jt;