CreateSemanticSearchIndex[source]
source 内のデータから検索索引を作成する.
CreateSemanticSearchIndex[{source1,…}]
ソース sourceiの集合から検索索引を作成する.
CreateSemanticSearchIndex[{source1val1,…}]
ソース sourceiを値 valiに関連付ける.
CreateSemanticSearchIndex[data,"name"]
検索索引に指定された名前を与える.
CreateSemanticSearchIndex
CreateSemanticSearchIndex[source]
source 内のデータから検索索引を作成する.
CreateSemanticSearchIndex[{source1,…}]
ソース sourceiの集合から検索索引を作成する.
CreateSemanticSearchIndex[{source1val1,…}]
ソース sourceiを値 valiに関連付ける.
CreateSemanticSearchIndex[data,"name"]
検索索引に指定された名前を与える.
詳細とオプション
- CreateSemanticSearchIndexは,内容の意味的検索に使える特徴をテキストから抽出するために使われる.
- 次は,source の可能な値である.
-
"string" プレーンな文字列 File["path"] 個々のファイル URL["url"] "url"のテキスト表現 CloudObject[…] クラウドオブジェクト LocalObject[…] ローカルオブジェクト ContentObject[…] コンテンツオブジェクト {source1,source2,…} ソースのリスト - ソースには注釈が付けられる.同じソースからのものには同じ注釈が付けられる.
- 次は,注釈を指定する可能な方法である.
-
{source1val1,…} ソースと関連付けられた値のリスト {source1,…}{val1,…} ソースと値の間の規則 - 次は,許容される valiの形式である.
-
"string" 文字列ラベル <|"tag1"v1,…|> タグとメタデータ値の連想 - CreateSemanticSearchIndexは,以下のオプションをサポートする.
-
DistanceFunction EuclideanDistance 使用する距離関数 FeatureExtractor "MiniLM" テキストの断片から特徴をどのように抽出するか GeneratedAssetLocation $GeneratedAssetLocation 索引の場所 Method Automatic メソッドの詳細 OverwriteTarget Automatic 既存の場所に上書きするかどうか ProgressReporting $ProgressReporting 計算の進捗状況を報告するかどうか WorkingPrecision "Real32" 浮動小数点演算の精度 - DistanceFunctionの可能な値には,EuclideanDistance,SquaredEuclideanDistance,CosineDistance,JaccardDissimilarity,HammingDistanceがある.
- 次は,FeatureExtractorの可能な値である.
-
"MiniLM" SentenceBERTに基づくローカルモデル LLMConfiguration LLMに基づく文の埋込み f カスタムの抽出関数 - カスタムの抽出器 f は,文字列のリストに作用して同じ長さのベクトルのリストを生成しなければならない.
- より細かいオプションは,Method<|opt1val1|>を使って与えることができる.次は,optiの可能な値である.
-
"ContextPadding" 
断片間の最小のオーバーラップ "MaximumItemLength" 
テキストの断片の最大の長さ "MinimumItemLength" 
テキストの断片の最小の長さ "SplitPattern" Automatic 長い文字列をどこで分割するか - 自動"SplitPattern"は,ラグラフ,改行,単語内のソーステキストを分割して,"MinimumItemLength"から"MaximumItemLength"までの長さの断片を作成しようとする.
- 次は,WorkingPrecisionの可能な設定である.
-
"Integer8" -128から127までの符号付き8ビット整数 "Real32" 単精度実数(32ビット) "Real64" 倍精度実数(64ビット)
例題
すべて開く すべて閉じる例 (2)
新たなSemanticSearchIndexを作成する:
index = CreateSemanticSearchIndex[ResourceData["Alice in Wonderland"], "Alice"]Short /@ SemanticSearch[index, "talking insect", MaxItems -> 4]index = CreateSemanticSearchIndex[{ResourceData["Alice in Wonderland"] -> "Alice", ResourceData["Death in Venice"] -> "Venice"}]SemanticSearch[index, "insects"]スコープ (6)
データソース (4)
CreateSemanticSearchIndex["Cats, with their mysterious charm and playful antics, effortlessly capture our hearts, prancing gracefully through sunbeams, curling up in cozy spots, and purring softly, reminding us of the joy they bring."]CreateSemanticSearchIndex[File["ExampleData/USConstitution.txt"]]CreateSemanticSearchIndex[URL["http://www.wolfram.com"]]CreateSemanticSearchIndex[ResourceData["Alice in Wonderland"], "Alice"]注釈 (2)
index = CreateSemanticSearchIndex[{ResourceData["Friends, Romans, Countrymen"] -> "Caesar", ResourceData["JFK Inaugural Address"] -> "JFK"}]index["Label"]SemanticSearch[index, "honour"]CreateSemanticSearchIndex[{ResourceData["Alice in Wonderland"] -> <|"Author" -> "Lewis Carroll", "Date" -> 1865 |>, ResourceData["Friends, Romans, Countrymen"] -> <|"Author" -> "William Shakespeare", "Date" -> 1609|>}]別のAssociationで注釈をん指定する:
CreateSemanticSearchIndex[{ResourceData["Alice in Wonderland"], ResourceData["Friends, Romans, Countrymen"]} -> {<|"Author" -> "Lewis Carroll", "Date" -> 1865|>, <|"Author" -> "William Shakespeare", "Date" -> 1609|>}]オプション (11)
DistanceFunction (1)
CreateSemanticSearchIndex[{"beautiful", "mysterious", "vibrant", "ancient"}, DistanceFunction -> CosineDistance]デフォルトで,EuclideanDistanceが使われる:
CreateSemanticSearchIndex[{"beautiful", "mysterious", "vibrant", "ancient"}]["Database"]["DistanceFunction"]FeatureExtractor (2)
fe = FeatureExtraction[TextWords@ResourceData["Declaration of Independence"]]CreateSemanticSearchIndex[ResourceData["A Far Country"], FeatureExtractor -> fe]CreateSemanticSearchIndex[{"hi there"}, FeatureExtractor -> LLMConfiguration["Model" -> {"OpenAI", "text-embedding-3-small"}]]GeneratedAssetLocation (3)
index = CreateSemanticSearchIndex[ResourceData["Declaration of Independence"], GeneratedAssetLocation -> "CloudObject"]index["Location"]CreateSemanticSearchIndex[RandomWord[10]]["Location"]file = File[FileNameJoin[{$TemporaryDirectory, "testfile"}]]CreateSemanticSearchIndex[RandomWord[10], GeneratedAssetLocation -> file]%["Location"]SemanticSearchIndex[File["/private/var/folders/05/v_ct9frn7zv4vy6f2q18y2r80000gn/T/testfile"]]Method (2)
text = "abacus: a calculator that performs arithmetic functions by manually sliding counters on rods or in groovesa tablet placed horizontally on top of the capital of a column as an aid in supporting the architrave
abaft: at or near or toward the stern of a ship or tail of an airplanepreposition
abalone: any of various large edible marine gastropods of the genus Haliotis having an ear-shaped shell with pearly interior
abandoned: forsaken by owner or inhabitants free from constraint";CreateSemanticSearchIndex[text]項目の最短と最長の長さを調整して,より関連生が高いセクションに分割する:
CreateSemanticSearchIndex[text, Method -> {"MinimumItemLength" -> 1, "MaximumItemLength" -> 64}]definitions = Map[StringJoin[#, ": ", WordDefinition[#]]&, RandomWord[50]];
Short[definitions]text = StringRiffle[definitions, " !!! "];デフォルトの自動的なパラグラフと文の分離による結果は好ましいものではない:
First@CreateSemanticSearchIndex[text]["Items"]カスタムの分離パターンを使ってカスタムの分離記号を使って分離する:
First@CreateSemanticSearchIndex[text, Method -> <|"SplitPattern" -> StringExpression["!!!"], "MinimumItemLength" -> 4|>]["Items"]OverwriteTarget (2)
CreateSemanticSearchIndex[StringRiffle[RandomWord[10]], "myDB"]デフォルトのOverwriteTargetAutomaticでは,衝突を避けるために新たな索引名が生成される:
CreateSemanticSearchIndex[StringRiffle[RandomWord[10]], "myDB"]強制的に上書きしたければOverwriteTargetTrueを使うとよい:
CreateSemanticSearchIndex[StringRiffle[RandomWord[10]], "myDB", OverwriteTarget -> True]OverwriteTargetFalseを使って厳密にチェックする:
CreateSemanticSearchIndex[RandomWord[10], "myDB", OverwriteTarget -> False]OverwriteTargetFalseは,同じ索引名を別の場所で再度使用することも防ぐ:
CreateSemanticSearchIndex[RandomWord[10], "myDB", GeneratedAssetLocation -> File["myDBfile"], OverwriteTarget -> False]CreateFile@File["myIndexfile"]CreateSemanticSearchIndex[RandomWord[10], GeneratedAssetLocation -> File["myIndexfile"]]OverwriteTargetTrueを使って既存のファイルを上書きする:
CreateSemanticSearchIndex[RandomWord[10], GeneratedAssetLocation -> File["myIndexfile"], OverwriteTarget -> True]WorkingPrecision (1)
アプリケーション (2)
data = Map[StringRiffle[WordDefinition[#]] -> #&, WordList[]];CreateSemanticSearchIndex[data, "definitions"]SemanticSearch["definitions", "small land insect"]index = CreateSemanticSearchIndex[ResourceData["Shakespeare's Sonnets"]]SemanticSearch[index, "a day in the summer", MaxItems -> 1]特性と関係 (1)
text = "This is a sentence."
semanticEmbeddings = Normal@CreateSemanticSearchIndex[text]["Embeddings"];
Short[semanticEmbeddings]FeatureExtractは,指定された"SentenceVector"抽出器を使って同様の埋込みが作成できる:
featureEmbeddings = FeatureExtract[{text}, "SentenceVector"];
Short@featureEmbeddings考えられる問題 (2)
CreateSemanticSearchIndex["https://www.wolfram.com"]["Items"]リンクを辿る場合はURLラッパーを使う:
CreateSemanticSearchIndex[URL["https://www.wolfram.com"]]["Items"]//First//ShortFileを使ってコンテンツをインポートする:
FileCreateSemanticSearchIndex[File["ExampleData/USConstitution.txt"]]["Items"]//First//Shorttext = "abacus: a calculator that performs arithmetic functions by manually sliding counters on rods or in groovesa tablet placed horizontally on top of the capital of a column as an aid in supporting the architrave
abaft: at or near or toward the stern of a ship or tail of an airplanepreposition
abalone: any of various large edible marine gastropods of the genus Haliotis having an ear-shaped shell with pearly interior
abandoned: forsaken by owner or inhabitants free from constraint";文字列の長さがデフォルトの最大長より短いので分割は行われない:
index = CreateSemanticSearchIndex[text, Method -> {"MinimumItemLength" -> 1}]index = CreateSemanticSearchIndex[text, Method -> {"MinimumItemLength" -> 1, "MaximumItemLength" -> 64}]関連するガイド
テキスト
Wolfram Research (2024), CreateSemanticSearchIndex, Wolfram言語関数, https://reference.wolfram.com/language/ref/CreateSemanticSearchIndex.html (2025年に更新).
CMS
Wolfram Language. 2024. "CreateSemanticSearchIndex." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/CreateSemanticSearchIndex.html.
APA
Wolfram Language. (2024). CreateSemanticSearchIndex. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CreateSemanticSearchIndex.html
BibTeX
@misc{reference.wolfram_2026_createsemanticsearchindex, author="Wolfram Research", title="{CreateSemanticSearchIndex}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/CreateSemanticSearchIndex.html}", note=[Accessed: 09-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_createsemanticsearchindex, organization={Wolfram Research}, title={CreateSemanticSearchIndex}, year={2025}, url={https://reference.wolfram.com/language/ref/CreateSemanticSearchIndex.html}, note=[Accessed: 09-September-2026]}