Owns vector search indexing and querying for websites, delegating the actual work to a VectorSearchService. Registered as the vectorSearchManager service, reachable from JS. Use indexItemBuilder and searchParametersBuilder to construct the inputs for indexing and searching, then call the corresponding methods on this manager.
Group: Managers
Methods
indexItemBuilder() · searchParametersBuilder() · search(Website website, SearchParameters parameters) · deleteIndex(Website website) · deleteIndex(String indexName, Website website) · indexItems(List<IndexItem> items, Website website, String indexName) · deleteItems(List<String> ids, Website website) · deleteItem(String id, Website website) · setWebsiteIndex(String indexName, Website website) · createIndex(Website website)
indexItemBuilder()
Returns: IndexItemBuilder
Creates a new, empty builder for assembling an IndexItem to add to a website's search index.
searchParametersBuilder()
Returns: SearchParametersBuilder
Creates a new, empty builder for assembling the parameters of a vector search.
search(Website website, SearchParameters parameters)
Returns: VectorSearchResult
Runs a vector search against the given website's index, matching and ranking documents against the supplied search terms and returning the highlighted results. Expensive - it embeds the query and calls out to the search engine.
| Parameter | Description |
|---|---|
website | the website whose index is searched |
parameters | the search terms, paging and highlighting options |
deleteIndex(Website website)
Returns: boolean
Deletes the given website's current search index, if it exists.
| Parameter | Description |
|---|---|
website | the website whose index is deleted |
deleteIndex(String indexName, Website website)
Returns: boolean
Deletes the named search index belonging to the given website, if it exists.
| Parameter | Description |
|---|---|
indexName | the name of the index to delete |
website | the website that owns the index |
indexItems(List<IndexItem> items, Website website, String indexName)
Returns: boolean
Adds or replaces a batch of documents in the named search index for the given website. Expensive - it embeds each item's title and content and sends the batch to the search engine.
| Parameter | Description |
|---|---|
items | the documents to index |
website | the website that owns the index |
indexName | the name of the index to write to |
deleteItems(List<String> ids, Website website)
Returns: void
Removes the documents with the given ids from the given website's search index.
| Parameter | Description |
|---|---|
ids | the ids of the documents to remove |
website | the website that owns the index |
deleteItem(String id, Website website)
Returns: boolean
Removes a single document with the given id from the given website's search index.
| Parameter | Description |
|---|---|
id | the id of the document to remove |
website | the website that owns the index |
setWebsiteIndex(String indexName, Website website)
Returns: void
Records the named index as the search index the given website should use for subsequent searches and indexing calls.
| Parameter | Description |
|---|---|
indexName | the name of the index to use |
website | the website to set the index for |
createIndex(Website website)
Returns: String
Creates a new, empty search index schema for the given website, ready to have documents added. Does not make the new index the website's active index - call setWebsiteIndex with the returned name to do that.
| Parameter | Description |
|---|---|
website | the website to create an index for |