SemanticSearch
SemanticSearch[index,query]
finds the items similar to query inside index.
SemanticSearch[index,query,prop]
returns the specified property prop.
Details and Options
![](Files/SemanticSearch.en/details_1.png)
- SemanticSearch performs a search on the semantic index using a query to find and retrieve similar text items.
- The index is a SemanticSearchIndex[…] expression or the name of a saved index.
- Possible values for query include:
-
"query" a textual query (default) "query"f a query followed by a filtering operation - The input to the function f is the same tag specified when the index was created.
- Possible values for prop include:
-
"Distance" distance between the encoded query and item "Item" items that match "query" (default) "ItemEmbedding" encoded item "Label" item label "Query" specified query "QueryEmbedding" encoded query "Source" item source "Tags" item tags {prop1,…} a list of properties All all the available properties for each item - The following options can be given:
-
MaxItems 10 how many items are returned ProgressReporting $ProgressReporting whether to display progress information
Examples
open allclose allBasic Examples (1)
Create a SemanticSearchIndex:
Extract the most relevant quote from the Declaration of Independence:
Scope (5)
Find the most semantically relevant matches in an index:
Get a list of available result properties:
Extract a specific result property:
Define an index with labeled sources:
The label is automatically returned when searching:
Define an index with tagged sources:
Text
Wolfram Research (2024), SemanticSearch, Wolfram Language function, https://reference.wolfram.com/language/ref/SemanticSearch.html.
CMS
Wolfram Language. 2024. "SemanticSearch." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SemanticSearch.html.
APA
Wolfram Language. (2024). SemanticSearch. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SemanticSearch.html