CreateSearchIndex [dir]
creates a search index from all files in the directory dir and its subdirectories.
CreateSearchIndex [{source1,source2,…}]
creates a search index from all sources sourcei.
CreateSearchIndex [sources,"name"]
gives the search index the specified name.
creates an empty search index, which can be added to with AddToSearchIndex .
CreateSearchIndex
CreateSearchIndex [dir]
creates a search index from all files in the directory dir and its subdirectories.
CreateSearchIndex [{source1,source2,…}]
creates a search index from all sources sourcei.
CreateSearchIndex [sources,"name"]
gives the search index the specified name.
creates an empty search index, which can be added to with AddToSearchIndex .
Details and Options
- CreateSearchIndex yields a SearchIndexObject .
- Possible sources used in CreateSearchIndex include:
-
{obj1,obj2,…} list of indexable objects
- SearchIndices [] gives the list of search indices created by CreateSearchIndex .
- CreateSearchIndex has the following options:
-
- Possible settings for Method include "BM25" and "TFIDF".
Examples
open all close allBasic Examples (2)
Create a search index from two files:
TextSearch searches in the index:
Create a search index from all files and subfolders in a folder:
Search the index:
Options (2)
ContentFieldOptions (1)
Set a weight of 2 for the "Keywords" field:
DocumentWeightingRules (1)
Weight documents according to the value of a "Quality" field:
Related Guides
Text
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.
APA
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: 17-November-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: 17-November-2025]}