SemanticSearchIndex

SemanticSearchIndex[]

represents a semantic search index object.

SemanticSearchIndex[source]

attempts to recreate a SemanticSearchIndex from source.

Details and Options

  • SemanticSearchIndex represents a corpus of documents that can be searched by semantic similarity.
  • Usually created by CreateSemanticSearchIndex, this symbolic object enables common semantic index operations such as adding additional documents, searching and listing content and properties.
  • Possible values of source include:
  • "name"a named index from SemanticSearchIndices[]
    File[]a local file
    LocalObject[]a local object
    CloudObject[]a cloud object
  • Index properties can be accessed via SemanticSearchIndex[]["prop"].
  • The following properties are supported:
  • "Database"vector database backing the index
    "DocumentCount"number of documents stored in the index
    "Embeddings"vector embeddings of the entries
    "FeatureExtractor"how features are extracted from text chunks
    "ID"index ID
    "ItemCount"number of chunks stored in the index
    "Items"stored chunks
    "Label"item labels
    "Location"where the index is stored
    "TagKeys"keys of the tag association
    "Tags"tags associated with each entry
    {prop1,}a list of properties
  • The following options can be specified:
  • GeneratedAssetLocation $GeneratedAssetLocationwhere to save the index
    OverwriteTarget Automaticwhether to overwrite an existing location

Examples

open allclose all

Basic Examples  (2)

Create a semantic search index:

Extract stored text:

Create a semantic search index based on a single source:

Perform a semantic search operation:

Scope  (7)

Properties  (3)

Extract a list of index properties:

Extract the stored items:

Extract multiple properties at once:

Retrieve the VectorDatabaseObject storing the embeddings:

Annotations  (3)

Create an index where each source is associated with a label:

Each item is labeled:

Labels can also be accessed via the "Tags" property:

Explicitly specify a label and other tags:

Retrieve all the labels:

Create a semantic search index with multiple custom tags:

Access only a specific tag:

Access multiple tags:

Access tags and other properties:

Retrieval  (1)

Store a SemanticSearchIndex in a file:

Recreate the index from the file:

Recreate the index from the name:

Options  (2)

GeneratedAssetLocation  (1)

Create a SemanticSearchIndex:

Copy the index in a new location:

Delete the original index:

Retrieve the index from its new location:

OverwriteTarget  (1)

Create a new index:

Create a new file:

By default, copying a index to an existing file will fail:

Use OverwriteTarget -> True to override the existing file:

Applications  (1)

Use an index to perform a search operation:

Properties & Relations  (3)

In many situations, an existing semantic search index can be referred to by name only:

Search using the index's name:

This is equivalent to:

A semantic search index is backed by a VectorDatabaseObject:

Retrieve the underlying index:

Detailed information on the database can be extracted using vector database properties:

Create a file-backed index:

Index information is stored in the "WXF" format:

More files may be generated for efficiently storing the index information:

Possible Issues  (2)

Create an index in a specified location:

A naked string is interpreted as the index name:

Use the File wrapper to specify the source is a file path:

Create a path:

Create an index in the specified location:

Move underlying files:

The original index is no longer usable:

Use SemanticSearchIndex on the moved file with OverwriteTarget True to recreate the index and update the location data:

Wolfram Research (2024), SemanticSearchIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/SemanticSearchIndex.html (updated 2025).

Text

Wolfram Research (2024), SemanticSearchIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/SemanticSearchIndex.html (updated 2025).

CMS

Wolfram Language. 2024. "SemanticSearchIndex." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/SemanticSearchIndex.html.

APA

Wolfram Language. (2024). SemanticSearchIndex. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SemanticSearchIndex.html

BibTeX

@misc{reference.wolfram_2024_semanticsearchindex, author="Wolfram Research", title="{SemanticSearchIndex}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/SemanticSearchIndex.html}", note=[Accessed: 21-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_semanticsearchindex, organization={Wolfram Research}, title={SemanticSearchIndex}, year={2025}, url={https://reference.wolfram.com/language/ref/SemanticSearchIndex.html}, note=[Accessed: 21-January-2025 ]}