Class JSONIndexBuilder
java.lang.Object
dev.langchain4j.store.embedding.oracle.JSONIndexBuilder
This index builder allows to configure indexes on one or several keys of the
metadata column of the EmbeddingTable
.
It configures a function-based index using the same function used by the store to filter using the metadata column.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Use ASC or DESC to indicate whether the index should be created in ascending or descending order. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the index object configured by this builder.createOption
(CreateOption createOption) Configures the option to create (or not create) an index.isBitmap
(boolean isBitmap) Specify BITMAP to indicate that index is to be created with a bitmap for each distinct key, rather than indexing each row separately.isUnique
(boolean isUnique) Specify UNIQUE to indicate that the value of the column (or columns) upon which the index is based must be unique.key
(String key, Class<?> keyType, JSONIndexBuilder.Order order) Adds a column expression to the index expression that allows to index the value of a given key of the JSON column.Sets the index name.
-
Field Details
-
indexName
The name of the index, or null if no name was set.
-
-
Method Details
-
isUnique
Specify UNIQUE to indicate that the value of the column (or columns) upon which the index is based must be unique. Note that you cannot specify both UNIQUE and BITMAP.- Parameters:
isUnique
- True if the index should be UNIQUE otherwise false;- Returns:
- This builder.
-
isBitmap
Specify BITMAP to indicate that index is to be created with a bitmap for each distinct key, rather than indexing each row separately.- Parameters:
isBitmap
- True if the index should be BITMAP otherwise false;- Returns:
- This builder.
-
key
Adds a column expression to the index expression that allows to index the value of a given key of the JSON column.- Parameters:
key
- The key to index.keyType
- The java class of the metadata column.order
- The order the index should be created in.- Returns:
- This builder.
- Throws:
IllegalArgumentException
- If the key is null or empty, if the sqlType is null or if the order is null
-
build
Builds the index object configured by this builder.- Returns:
- The index object.
-
createOption
Configures the option to create (or not create) an index. The default isCreateOption.CREATE_IF_NOT_EXISTS
, which means that an index will be created if an index with the same name does not already exist.- Parameters:
createOption
- The create option.- Returns:
- This builder.
- Throws:
IllegalArgumentException
- If createOption is null.
-
name
Sets the index name.- Parameters:
indexName
- The name of the index.- Returns:
- This builder.
-