CreateSearchIndex
✖
CreateSearchIndex
[Experimental]
✖
CreateSearchIndex[dir]
creates a search index from all files in the directory dir and its subdirectories.
Details and Options

- CreateSearchIndex yields a SearchIndexObject.
- Possible sources used in CreateSearchIndex include:
-
"file" or File[…] individual file "dir" or File[…] directory of files ContentObject[…] content with metadata {obj1,obj2,…} list of indexable objects - SearchIndices[] gives the list of search indices created by CreateSearchIndex.
- CreateSearchIndex has the following options:
-
ContentFieldOptions Automatic options for handling fields in the content ContentLocationFunction Automatic function to determine how to locate content DocumentWeightingRules None weighting of documents based on the values of certain fields Language Automatic what language to assume text is in Method Automatic what indexing method to use OverwriteTarget False whether to allow overwriting an existing index - Possible settings for Method include "BM25" and "TFIDF".
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Create a search index from two files:
In[1]:=1

✖
https://wolfram.com/xid/0fq4rorku4ym1-n3c07l
Out[1]=1

TextSearch searches in the index:
In[2]:=2

✖
https://wolfram.com/xid/0fq4rorku4ym1-vnvf8e
Out[2]=2

Create a search index from all files and subfolders in a folder:
In[1]:=1

✖
https://wolfram.com/xid/0fq4rorku4ym1-tjol62
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0fq4rorku4ym1-r0rdgb
Out[2]=2

Options (2)Common values & functionality for each option
ContentFieldOptions (1)
Wolfram Research (2015), CreateSearchIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/CreateSearchIndex.html (updated 2019).
✖
Wolfram Research (2015), CreateSearchIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/CreateSearchIndex.html (updated 2019).
Text
Wolfram Research (2015), CreateSearchIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/CreateSearchIndex.html (updated 2019).
✖
Wolfram Research (2015), CreateSearchIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/CreateSearchIndex.html (updated 2019).
CMS
Wolfram Language. 2015. "CreateSearchIndex." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/CreateSearchIndex.html.
✖
Wolfram Language. 2015. "CreateSearchIndex." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/CreateSearchIndex.html.
APA
Wolfram Language. (2015). CreateSearchIndex. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CreateSearchIndex.html
✖
Wolfram Language. (2015). CreateSearchIndex. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CreateSearchIndex.html
BibTeX
✖
@misc{reference.wolfram_2025_createsearchindex, author="Wolfram Research", title="{CreateSearchIndex}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/CreateSearchIndex.html}", note=[Accessed: 19-June-2025
]}
BibLaTeX
✖
@online{reference.wolfram_2025_createsearchindex, organization={Wolfram Research}, title={CreateSearchIndex}, year={2019}, url={https://reference.wolfram.com/language/ref/CreateSearchIndex.html}, note=[Accessed: 19-June-2025
]}