AUTOCOMPLETE
The following procedures and function in the DBMS_SEARCH package enable implementation of Autocomplete. Autocomplete is a search-as-you-type technique used for improving query productivity. It finishes a term or phrase based on partial input by predicting and suggesting possible completions of a word or query. This leads to a faster, more user-friendly search experience by helping to find items even with incomplete or partially mistyped queries.
| Name | Description |
|---|---|
DBMS_SEARCH.CREATE_AUTOCOMPLETE_INDEX procedure |
Creates an autocomplete index on the specified table or JSON column, enabling fast and relevant autocomplete suggestions. |
DBMS_SEARCH.DROP_AUTOCOMPLETE_INDEX procedure |
Removes an existing autocomplete index. |
DBMS_SEARCH.AUTOCOMPLETE function |
Queries an autocomplete index and returns ranked suggestions based on partial user input. |
A high level workflow to implement the autocomplete feature using the DBMS_SEARCH autocomplete procedures and function:
-
Create a table to store your data. For JSON data, create a table with a JSON column.
-
Load the data you want to provide autocomplete suggestions for. Load data into the table created in step 1.
- Create the autocomplete index on the relevant column or JSON field by using
DBMS_SEARCH.CREATE_AUTOCOMPLETE_INDEXprocedure. - Query for autocomplete suggestions by using the
DBMS_SEARCH.AUTOCOMPLETEfunction with the partial query input to get ranked autocomplete suggestions.