Fluent builder for assembling an IndexItem to add to a website's vector search index. Obtained from VectorSearchManager.indexItemBuilder, populated with the fields to index, and finished with build to produce the immutable IndexItem passed to VectorSearchManager.indexItems.
Group: Builders
Methods
id(String id)
Returns: IndexItemBuilder
Sets the document's unique identifier within its index. If left unset, the search service assigns a random id when the item is indexed.
| Parameter | Description |
|---|---|
id | the document's id |
title(String s)
Returns: IndexItemBuilder
Sets the document's title, which is indexed and embedded alongside the content for search matching.
| Parameter | Description |
|---|---|
s | the document's title |
content(String s)
Returns: IndexItemBuilder
Sets the document's full text content, which is indexed and embedded for search matching.
| Parameter | Description |
|---|---|
s | the document's full text content |
type(String s)
Returns: IndexItemBuilder
Sets the type name identifying what kind of content the document represents.
| Parameter | Description |
|---|---|
s | the document's type name |
path(String s)
Returns: IndexItemBuilder
Sets the path of the document within the website, used to link back to the original item from search results.
| Parameter | Description |
|---|---|
s | the document's path within the website |
types(List<String> typestypes)
Returns: IndexItemBuilder
Replaces the document's asset type tags, used to restrict which users can see it in search results.
| Parameter | Description |
|---|---|
typestypes | the document's asset type tags |
addType(String type)
Returns: IndexItemBuilder
Adds a single asset type tag to the document's existing list of types.
| Parameter | Description |
|---|---|
type | the asset type tag to add |
build()
Returns: IndexItem
Builds the immutable IndexItem from the fields set on this builder, ready to be passed to VectorSearchManager.indexItems.